ruff/crates/ty_python_semantic/resources
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
..
mdtest [ty] Infer parameter specializations of explicitly implemented generic protocols (#18054) 2025-05-13 13:13:00 -04:00
primer [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
README.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00

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.