Crash if a class is generic over a PEP-695 parameter that has the same name as an old-style TypeVar
that is also in scope and the old-style TypeVar has a bound which uses an unquoted forward reference
#18507
Labels
Crash Report
This feels quite specific, but I think it may come up a surprising amount as more and more people use codemods to try to auto-upgrade their code to use PEP 695 in the coming years! Mypy crashes on this snippet:
The following things must all be true for the crash to occur:
Bar
bound=
argument that uses a forward reference.py
files, you generally need to quote all forward references, but this is not true for stubs.)Traceback
To Reproduce
Paste the above snippet into a
foo.py
file and runmypy --python-version=3.12 foo.py --show-traceback
Your Environment
1.15.0+dev.58de753b6b76227ff726e9ce1888cfc24c7ba44b
--python-version=3.12 --show-traceback
The text was updated successfully, but these errors were encountered: