ruff
937ac6e6 - [ty] Guard descriptor classification cycles (#26690)

Commit
37 days ago
[ty] Guard descriptor classification cycles (#26690) ## Summary Our data-descriptor predicates recursively inspect outer unions, intersections, and type aliases. An unguarded recursive alias can therefore revisit the same classification: ```python class Descriptor: def __set__(self, instance: object, value: object) -> None: ... type NonData = int | NonDataTail type NonDataTail = NonData type Data = Descriptor | DataTail type DataTail = Data ``` We now evaluate both descriptor classifiers as Salsa queries and route alias expansion back through those queries. Definite classifications use `true`, the identity for their all-of union folds, as cycle recovery; possible-data classification uses `false`, the identity for its any-of fold. The regression test exercises `is_data_descriptor`, `may_be_data_descriptor`, and `is_definitely_non_data_descriptor` for recursive aliases with and without a reachable data descriptor.
Author
Parents
Loading