Closed as not planned
Closed as not planned
Description
Bug Report
To Reproduce
import typing as t
if t.TYPE_CHECKING:
Something = t.TypeVar("Something")
class Xxx(t.Generic['Something']):
...
def lol(x: Xxx[int]) -> None:
...
Expected Behavior
Same as the following code (which is passes the type-check):
import typing as t
if t.TYPE_CHECKING: # to not fail in runtime this should be removed too, however, I wanted to show that minimal changes affect the result
Something = t.TypeVar("Something")
class Xxx(t.Generic[Something]):
...
def lol(x: Xxx[int]) -> None:
...
Actual Behavior
main.py:6: error: Free type variable expected in Generic[...] [misc]
main.py:9: error: "Xxx" expects no type arguments, but 1 given [type-arg]
Found 2 errors in 1 file (checked 1 source file)
Your Environment
- Mypy version used: mypy 1.11.0 (compiled: yes)
- Mypy command-line flags: default
- Mypy configuration options from
mypy.ini
(and other config files): - Python version used: 3.10