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
Currently the code around type variable binding in functions is a bit unclear and does some strange things like binding typer variables before function type is analyzed and depending on TypeVarQuery returning short (unqualified) names.
Probably it makes sense to clean up (or at least document) various things related to type variable scopes while we are working on the new semantic analyzer. I just discovered an inconsistency in new analyzer, it was using full type variable name where short one was expected. Without documentation, such errors are easy to make.
FWIW I more happy now with how type variables work (e.g. we use namespaces everywhere). There still may be bugs, I think tvar_scope.py is somewhat over-complicated, but we can handle issues on one-by-one basis now.
Activity
ilevkivskyi commentedon Aug 19, 2018
Another related comment here is that we have a bit too many "things" related to type variables (in addition to
TypeVarScopementioned above):TypeVarExprTypeVarDefTypeVarTypeTypeVarIdWe can probably simplify a bit the model of how type variables work.
ilevkivskyi commentedon Feb 24, 2019
Probably it makes sense to clean up (or at least document) various things related to type variable scopes while we are working on the new semantic analyzer. I just discovered an inconsistency in new analyzer, it was using full type variable name where short one was expected. Without documentation, such errors are easy to make.
Merge TypeVarDef and TypeVarType (#9951)
ilevkivskyi commentedon Jun 15, 2024
FWIW I more happy now with how type variables work (e.g. we use namespaces everywhere). There still may be bugs, I think
tvar_scope.pyis somewhat over-complicated, but we can handle issues on one-by-one basis now.