ruff/crates/ty_python_semantic/resources/mdtest/generics/pep695
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
..
aliases.md [ty] improve bad specialization results & error messages (#21840) 2025-12-11 19:21:34 -08:00
classes.md [ty] Avoid stack overflow when calculating inferable typevars (#21971) 2025-12-15 10:25:33 -05:00
functions.md [ty] Improve diagnostics for unsupported binary operations and unsupported augmented assignments (#21947) 2025-12-12 21:53:29 +00:00
paramspec.md [ty] Use `ParamSpec` without the attr for inferable check (#21934) 2025-12-15 11:04:28 +05:30
variables.md [ty] Use unqualified names for displays of `TypeAliasType`s and unbound `ParamSpec`s/`TypeVar`s (#21960) 2025-12-13 20:23:16 +00:00
variance.md [ty] impl `VarianceInferable` for `KnownInstanceType` (#20924) 2025-10-17 21:12:19 +02:00