Bug Report, To Reproduce, & Actual Behaviour
See mypy Playground:
type T = dict[str, "T"] # OK
from typing import TypeAliasType
T2 = TypeAliasType("T2", dict[str, "T2"]) # E: Cannot resolve name "T2" (possible cyclic definition) [misc]
Expected Behavior
Self-referential type successfully declared
Your Environment
- Mypy version used: 1.13.0
- Mypy command-line flags: (none)
- Mypy configuration options from
mypy.ini (and other config files): (none)
- Python version used: 3.12