-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[red-knot] simplify type lookup in function/class definitions (#14303)
When we look up the types of class bases or keywords (`metaclass`), we currently do this little dance: if there are type params, then look up the type using `SemanticModel` in the type-params scope, if not, look up the type directly in the definition's own scope, with support for deferred types. With inference of function parameter types, I'm now adding another case of this same dance, so I'm motivated to make it a bit more ergonomic. Add support to `definition_expression_ty` to handle any sub-expression of a definition, whether it is in the definition's own scope or in a type-params sub-scope. Related to both #13693 and #14161.
- Loading branch information
Showing
1 changed file
with
27 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters