You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is the definition of f() not considered an error?
Because it is not unsafe. As discussed in #2885 we can't prohibit all possible useless annotations. Moreover now we have #4066, so that I think the way forward is to prohibit empty bodies (so that one can't make a body for such annotations).
It may not be unsafe, but I'm pretty sure that whenever you see that, the user misunderstands what type variables are on a fundamental level (e.g. they confuse them with type aliases).
The inferred type for
x
is unexpected (especially when using--strict-optional
):It would be better to require an annotation for
x
.The text was updated successfully, but these errors were encountered: