ruff/crates/ty_python_semantic/resources/mdtest/call
Dhruv Manilawala d43a3d34dd
[ty] Avoid unnecessary argument type expansion (#19999)
## Summary

Part of: https://github.com/astral-sh/ty/issues/868

This PR adds a heuristic to avoid argument type expansion if it's going
to eventually lead to no matching overload.

This is done by checking whether the non-expandable argument types are
assignable to the corresponding annotated parameter type. If one of them
is not assignable to all of the remaining overloads, then argument type
expansion isn't going to help.

## Test Plan

Add mdtest that would otherwise take a long time because of the number
of arguments that it would need to expand (30).
2025-08-21 06:13:11 +00:00
..
annotation.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
builtins.md [ty] Improve isinstance() truthiness analysis for generic types (#19668) 2025-08-01 14:44:22 +01:00
callable_instance.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
constructor.md [ty] Rename call-possibly-unbound-method to possibly-unbound-implicit-call (#18017) 2025-05-22 15:25:51 +00:00
dunder.md [ty] Allow declared-only class-level attributes to be accessed on the class (#19071) 2025-07-02 18:03:56 +02:00
dunder_import.md [ty] Add special-cased inference for __import__(name) and importlib.import_module(name) (#19008) 2025-06-29 11:49:23 +01:00
function.md [ty] Remove Type::Tuple (#19669) 2025-08-11 22:03:32 +01:00
getattr_static.md [ty] eliminate is_fully_static (#18799) 2025-06-24 18:02:05 -07:00
invalid_syntax.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
methods.md [ty] Sync vendored typeshed stubs (#19923) 2025-08-14 18:09:35 -07:00
never.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
overloads.md [ty] Avoid unnecessary argument type expansion (#19999) 2025-08-21 06:13:11 +00:00
replace.md [ty] synthesize __replace__ for dataclasses (>=3.13) (#19545) 2025-07-29 17:32:01 +02:00
str_startswith.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
subclass_of.md [ty] Include synthesized arguments in displayed counts for too-many-positional-arguments (#18098) 2025-05-14 22:51:23 -04:00
union.md [ty] eliminate is_fully_static (#18799) 2025-06-24 18:02:05 -07:00