ruff/crates/ty_python_semantic/resources/mdtest/call
Dhruv Manilawala 7ea773daf2
[ty] Argument type expansion for overload call evaluation (#18382)
## Summary

Part of astral-sh/ty#104, closes: astral-sh/ty#468

This PR implements the argument type expansion which is step 3 of the
overload call evaluation algorithm.

Specifically, this step needs to be taken if type checking resolves to
no matching overload and there are argument types that can be expanded.

## Test Plan

Add new test cases.

## Ecosystem analysis

This PR removes 174 `no-matching-overload` false positives -- I looked
at a lot of them and they all are false positives.

One thing that I'm not able to understand is that in
2b7e3adf27/sphinx/ext/autodoc/preserve_defaults.py (L179)
the inferred type of `value` is `str | None` by ty and Pyright, which is
correct, but it's only ty that raises `invalid-argument-type` error
while Pyright doesn't. The constructor method of `DefaultValue` has
declared type of `str` which is invalid.

There are few cases of false positives resulting due to the fact that ty
doesn't implement narrowing on attribute expressions.
2025-06-04 02:12:00 +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] Understand homogeneous tuple annotations (#17998) 2025-05-12 22:02:25 -04: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 put similar dunder-call tests next to each other (#18343) 2025-05-27 12:16:41 -07:00
function.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
getattr_static.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04: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_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
never.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
overloads.md [ty] Argument type expansion for overload call evaluation (#18382) 2025-06-04 02:12:00 +00: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_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00