ruff/crates/ty_python_semantic/resources
David Peter 58a68f1bbd
[ty] Fall back to Divergent for deeply nested specializations (#20988)
## Summary

Fall back to `C[Divergent]` if we are trying to specialize `C[T]` with a
type that itself already contains deeply nested specialized generic
classes. This is a way to prevent infinite recursion for cases like
`self.x = [self.x]` where type inference for the implicit instance
attribute would not converge.

closes https://github.com/astral-sh/ty/issues/1383
closes https://github.com/astral-sh/ty/issues/837

## Test Plan

Regression tests.
2025-10-22 14:29:10 +02:00
..
corpus [ty] fix deferred name loading in PEP695 generic classes/functions (#19888) 2025-08-13 15:51:59 -07:00
mdtest [ty] Fall back to Divergent for deeply nested specializations (#20988) 2025-10-22 14:29:10 +02:00
primer Fix run-away for mutually referential instance attributes (#20645) 2025-10-16 13:24:41 +02:00
README.md

Markdown files within the mdtest/ subdirectory are tests of type inference and type checking; executed by the tests/mdtest.rs integration test.

See crates/ty_test/README.md for documentation of this test format.