ruff
abfa3d6c - [ty] Detect recursive alias cycles through intersections (#28916)

Commit
15 days ago
[ty] Detect recursive alias cycles through intersections (#28916) ## Summary We now report `cyclic-type-alias-definition` instead of overflowing the stack for PEP 613 aliases such as: ```python from typing import TypeAlias A: TypeAlias = "~A & A" ``` Cycle detection now follows both positive and negative intersection elements, so intersections and negations cannot hide unguarded recursive references. This also covers mutual recursion and PEP 695 aliases, while recursion through a containing type remains valid. Closes https://github.com/astral-sh/ty/issues/4601.
Author
Parents
Loading