ruff/crates/ty_python_semantic/resources/mdtest/generics
Douglas Creager 47e3aa40b3
[ty] Specialize bound methods and nominal instances (#17865)
Fixes
https://github.com/astral-sh/ruff/pull/17832#issuecomment-2851224968. We
had a comment that we did not need to apply specializations to generic
aliases, or to the bound `self` of a bound method, because they were
already specialized. But they might be specialized with a type variable,
which _does_ need to be specialized, in the case of a "multi-step"
specialization, such as:

```py
class LinkedList[T]: ...

class C[U]:
    def method(self) -> LinkedList[U]:
        return LinkedList[U]()
```

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-05-05 17:17:36 -04:00
..
legacy [ty] Specialize bound methods and nominal instances (#17865) 2025-05-05 17:17:36 -04:00
pep695 [ty] Specialize bound methods and nominal instances (#17865) 2025-05-05 17:17:36 -04:00
builtins.md
scoping.md