Bug Report
Mypy segfaults when checking the following code.
To Reproduce
(Gist)
from typing import Self, Union
type OneClass = list[OneClass|int]
class TwoClass (list[Union['TwoClass',int]]):
@classmethod
def meth (cls, obj:Self|OneClass) -> Self|None:
if isinstance(obj, cls): return obj
Actual Behavior
In terminal:
Segmentation fault (core dumped) mypy test.py
In gist:
Your Environment
- Mypy version used: mypy 1.18.2 (compiled: yes)
- Mypy command-line flags: None
- Mypy configuration options from
mypy.ini (and other config files): None
- Python version used: Python 3.13.7
Bug Report
Mypy segfaults when checking the following code.
To Reproduce
(Gist)
Actual Behavior
In terminal:
In gist:
Your Environment
mypy.ini(and other config files): None