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
{{ message }}
Repository navigation
Code is not cheked after some function calls: binder/inference bug #3994
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:
fromtypingimportTypeVarT=TypeVar('T')
deff() ->T:
...
classC:
f()
1+'this is not checked'deffun() ->None:
f()
1+'can do everything here'ifTrue:
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.
I think that in a dynamic settings ()->T should not be considered as returning Uninhabited. Similarly to how T->T is not necessarily the identity function.
Activity
elazarg commentedon Sep 24, 2017
I think that in a dynamic settings
()->Tshould not be considered as returningUninhabited. Similarly to howT->Tis not necessarily the identity function.Check code after inferred UninhabitedType (#4059)