mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-28 02:39:59 +00:00
## Summary This just replaces one temporary solution to recursive protocols (the `SelfReference` mechanism) with another one (track seen types when recursively descending in `normalize` and replace recursive references with `Any`). But this temporary solution can handle mutually-recursive types, not just self-referential ones, and it's sufficient for the primer ecosystem and some other projects we are testing on to no longer stack overflow. The follow-up here will be to properly handle these self-references instead of replacing them with `Any`. We will also eventually need cycle detection on more recursive-descent type transformations and tests. ## Test Plan Existing tests (including recursive-protocol tests) and primer. Added mdtest for mutually-recursive protocols that stack-overflowed before this PR. |
||
|---|---|---|
| .. | ||
| module_resolver | ||
| semantic_index | ||
| types | ||
| util | ||
| ast_node_ref.rs | ||
| db.rs | ||
| dunder_all.rs | ||
| lib.rs | ||
| lint.rs | ||
| list.rs | ||
| module_name.rs | ||
| node_key.rs | ||
| place.rs | ||
| program.rs | ||
| pull_types.rs | ||
| python_platform.rs | ||
| semantic_index.rs | ||
| semantic_model.rs | ||
| site_packages.rs | ||
| suppression.rs | ||
| types.rs | ||
| unpack.rs | ||