Bug Report
To Reproduce
type A[S, T=S] = dict[S, T]
a: A[int] = {}
reveal_type(a)
Expected Behavior
note: Revealed type is "builtins.dict[builtins.int, builtins.int]"
Actual Behavior
error: Name "T" is not defined [name-defined]
note: Revealed type is "builtins.dict[builtins.int, Any]"
Your Environment
- Mypy version used: mypy 1.18.2 (compiled: yes)
- Mypy configuration options from
mypy.ini (and other config files):
[tool.mypy]
python_version = "3.13"
show_error_codes = true
- Python version used: 3.13
I can't repro in the playground, instead it says:
error: Invalid syntax. Maybe you meant '==' or ':=' instead of '='?; you likely need to run mypy using Python 3.13 or newer [syntax]
Bug Report
To Reproduce
Expected Behavior
Actual Behavior
Your Environment
mypy.ini(and other config files):I can't repro in the playground, instead it says: