6862bbd
2021-10-14
What program did you run?
def f():
return 1 + "foo"
f()
What happened?
The program passes type checks.
What should have happened?
We expected a compile-time error complaining that we can't add up int and str.
BTW, the type of int's __add__ method is printed in an interesting way, what does that type mean?
reveal_type((42).__add__)
# compiler.static.errors.TypedSyntaxError:
# reveal_type(int(42).__add__):
# 'int.__add__'
6862bbd
2021-10-14
What program did you run?
What happened?
The program passes type checks.
What should have happened?
We expected a compile-time error complaining that we can't add up
intandstr.BTW, the type of
int's__add__method is printed in an interesting way, what does that type mean?