ruff/crates/ty_python_semantic/resources/mdtest/generics
Douglas Creager cbfecfaf41
[ty] Avoid stack overflow when calculating inferable typevars (#21971)
When we calculate which typevars are inferable in a generic context, the
result might include more than the typevars bound by the generic
context. The canonical example is a generic method of a generic class:

```py
class C[A]:
    def method[T](self, t: T): ...
```

Here, the inferable typevar set of `method` contains `Self` and `T`, as
you'd expect. (Those are the typevars bound by the method.) But it also
contains `A@C`, since the implicit `Self` typevar is defined as `Self:
C[A]`. That means when we call `method`, we need to mark `A@C` as
inferable, so that we can determine the correct mapping for `A@C` at the
call site.

Fixes https://github.com/astral-sh/ty/issues/1874
2025-12-15 10:25:33 -05:00
..
legacy [ty] Emit diagnostic when a type variable with a default is followed by one without a default (#21787) 2025-12-14 19:35:37 +00:00
pep695 [ty] Avoid stack overflow when calculating inferable typevars (#21971) 2025-12-15 10:25:33 -05:00
builtins.md [ty] Support using legacy typing aliases for generic classes in type annotations (#18404) 2025-06-03 12:09:51 +01:00
scoping.md [ty] Enable even more goto-definition on inlay hints (#21950) 2025-12-12 12:57:38 -05:00
specialize_constrained.md [ty] Allow gradual lower/upper bounds in a constraint set (#21957) 2025-12-12 22:18:30 -05:00