Potential scoping issue when using TypeVar defaults in a class #7525
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Describe the bug
Assume there is a TypeVar A that depends on another TypeVar B for its default, and that there is a class generic over A and B. Any method using B but not A for annotations will show an error saying that the default type refers to a type parameter not in scope. I would've guessed that in a class context, A would be in scope, even if it isn't being used at the function level for a particular method.
Code or Screenshots
VS Code extension or command-line
command-line: pyright 1.1.355
The text was updated successfully, but these errors were encountered: