ruff/crates/ty_python_semantic/src
Douglas Creager c02bd11b93
[ty] Infer typevar specializations for `Callable` types (#21551)
This is a first stab at solving
https://github.com/astral-sh/ty/issues/500, at least in part, with the
old solver. We add a new `TypeRelation` that lets us opt into using
constraint sets to describe when a typevar is assignability to some
type, and then use that to calculate a constraint set that describes
when two callable types are assignable. If the callable types contain
typevars, that constraint set will describe their valid specializations.
We can then walk through all of the ways the constraint set can be
satisfied, and record a type mapping in the old solver for each one.

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2025-12-16 09:16:49 -08:00
..
module_resolver [ty] Improve resolution of absolute imports in tests (#21817) 2025-12-12 11:59:06 -05:00
semantic_index [ty] Adjust scope completions to use all reachable symbols 2025-12-11 08:26:15 -05:00
types [ty] Infer typevar specializations for `Callable` types (#21551) 2025-12-16 09:16:49 -08:00
ast_node_ref.rs [ty] Enable LRU collection for parsed module (#21749) 2025-12-03 12:16:18 +01:00
db.rs [ty] Limit shown import paths to at most 5 unless ty runs with `-v` (#20912) 2025-10-16 13:18:09 +02:00
diagnostic.rs [ty] Make Python-version subdiagnostics less verbose (#21849) 2025-12-08 15:58:23 +00:00
dunder_all.rs [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
lib.rs [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
lint.rs [ty] Add hyperlinks to rule codes in CLI (#21502) 2025-11-18 16:36:59 +01:00
list.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
module_name.rs [ty] Add support for relative import completions 2025-11-21 08:01:02 -05:00
node_key.rs [ty] Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248) 2025-09-05 17:56:06 +01:00
place.rs [ty] Add support for `__qualname__` and other implicit class attributes (#21966) 2025-12-13 17:10:25 -05:00
program.rs [ty] Remove mentions of VS Code from server logs (#21155) 2025-11-03 14:49:58 +00:00
pull_types.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
python_platform.rs Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
rank.rs [ty] Garbage-collect reachability constraints (#19414) 2025-07-21 14:16:27 -04:00
semantic_index.rs [ty] Avoid enforcing standalone expression for tests in f-strings (#21967) 2025-12-15 22:31:04 -05:00
semantic_model.rs [ty] Handle `Definition`s in `SemanticModel::scope` (#21919) 2025-12-11 18:04:57 +00:00
site_packages.rs [ty] Discover site-packages from the environment that ty is installed in (#21286) 2025-11-06 09:27:49 -05:00
subscript.rs [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
suppression.rs [ty] Fix crash when hovering an unknown string annotation (#21782) 2025-12-04 09:11:40 +01:00
types.rs [ty] Infer typevar specializations for `Callable` types (#21551) 2025-12-16 09:16:49 -08:00
unpack.rs [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00