ruff/crates
Dhruv Manilawala c7e020df6b
[ty] Filter overloads based on Any / Unknown (#18607)
## Summary

Closes: astral-sh/ty#552

This PR adds support for step 5 of the overload call evaluation
algorithm which specifies:

> For all arguments, determine whether all possible materializations of
the argument’s type are
> assignable to the corresponding parameter type for each of the
remaining overloads. If so,
> eliminate all of the subsequent remaining overloads.

The algorithm works in two parts:

1. Find out the participating parameter indexes. These are the
parameters that aren't gradual equivalent to one or more parameter types
at the same index in other overloads.
2. Loop over each overload and check whether that would be the _final_
overload for the argument types i.e., the remaining overloads will never
be matched against these argument types

For step 1, the participating parameter indexes are computed by just
comparing whether all the parameter types at the corresponding index for
all the overloads are **gradual equivalent**.

The step 2 of the algorithm used is described in [this
comment](https://github.com/astral-sh/ty/issues/552#issuecomment-2969165421).

## Test Plan

Update the overload call tests.
2025-06-17 15:35:09 +05:30
..
ruff
ruff_annotate_snippets
ruff_benchmark
ruff_cache
ruff_db [ty] Allow overriding rules for specific files (#18648) 2025-06-15 14:27:39 +01:00
ruff_dev
ruff_diagnostics
ruff_formatter
ruff_graph [ty] Allow overriding rules for specific files (#18648) 2025-06-15 14:27:39 +01:00
ruff_index
ruff_linter [pyupgrade] Suppress UP008 diagnostic if super symbol is not builtin (#18688) 2025-06-16 15:09:31 -04:00
ruff_macros [ty] Allow overriding rules for specific files (#18648) 2025-06-15 14:27:39 +01:00
ruff_notebook
ruff_options_metadata
ruff_python_ast
ruff_python_ast_integration_tests
ruff_python_codegen
ruff_python_formatter Hug closing } when f-string expression has a format specifier (#18704) 2025-06-17 07:39:42 +02:00
ruff_python_index
ruff_python_literal
ruff_python_parser Add syntax error when conversion flag does not immediately follow exclamation mark (#18706) 2025-06-16 11:44:42 -05:00
ruff_python_resolver
ruff_python_semantic
ruff_python_stdlib
ruff_python_trivia
ruff_python_trivia_integration_tests
ruff_server
ruff_source_file
ruff_text_size
ruff_wasm
ruff_workspace Drop confusing second * from glob pattern example (#18709) 2025-06-16 10:41:43 -04:00
ty [ty] Allow overriding rules for specific files (#18648) 2025-06-15 14:27:39 +01:00
ty_ide [ty] Reachability constraints (#18621) 2025-06-17 09:24:28 +02:00
ty_project [ty] Allow overriding rules for specific files (#18648) 2025-06-15 14:27:39 +01:00
ty_python_semantic [ty] Filter overloads based on Any / Unknown (#18607) 2025-06-17 15:35:09 +05:30
ty_server [ty] Add python.ty.disableLanguageServices config (#18230) 2025-06-17 13:50:45 +05:30
ty_test [ty] Allow overriding rules for specific files (#18648) 2025-06-15 14:27:39 +01:00
ty_vendored Sync vendored typeshed stubs (#18679) 2025-06-15 10:20:33 +01:00
ty_wasm