ruff/crates/ty_python_semantic/resources/mdtest/generics
Douglas Creager fe653de3dd
[ty] Infer parameter specializations of explicitly implemented generic protocols (#18054)
Follows on from (and depends on)
https://github.com/astral-sh/ruff/pull/18021.

This updates our function specialization inference to infer type
mappings from parameters that are generic protocols.

For now, this only works when the argument _explicitly_ implements the
protocol by listing it as a base class. (We end up using exactly the
same logic as for generic classes in #18021.) For this to work with
classes that _implicitly_ implement the protocol, we will have to check
the types of the protocol members (which we are not currently doing), so
that we can infer the specialization of the protocol that the class
implements.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-05-13 13:13:00 -04:00
..
legacy [ty] Infer parameter specializations of explicitly implemented generic protocols (#18054) 2025-05-13 13:13:00 -04:00
pep695 [ty] Infer parameter specializations of explicitly implemented generic protocols (#18054) 2025-05-13 13:13:00 -04:00
builtins.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
scoping.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00