-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Any code after an UninhabitedType is marked as unreachable in binder. This leads to dangerous behaviour together with how type inference currently works "in all uncertain situations infer uninhabited" (see also #3283 for discussion). For example no error is reported in this code:
from typing import TypeVar
T = TypeVar('T')
def f() -> T:
...
class C:
f()
1 + 'this is not checked'
def fun() -> None:
f()
1 + 'can do everything here'
if True:
f()
1 + 'whatever'There are other function signatures (all involve type variables) that lead to this behaviour: type checking stops after a call to such function.