ruff
9afd1ebd - [ty] Fix bug where ty would think that a `Callable` with a variadic positional parameter could be a subtype of a `Callable` with a positional-or-keyword parameter (#23610)

Commit
2 days ago
[ty] Fix bug where ty would think that a `Callable` with a variadic positional parameter could be a subtype of a `Callable` with a positional-or-keyword parameter (#23610) ## Summary On `main`, this assertion fails, but it should pass: ```py from ty_extensions import static_assert, is_subtype_of, is_assignable_to from typing import Protocol class A(Protocol): def __call__(self, *args: int | str): ... class B(Protocol): def __call__(self, a: int): ... static_assert(not is_assignable_to(A, B)) ``` A variadic positional parameter can never satisfy a positional-or-keyword parameter, because the former can never be passed a keyword argument, whereas the latter can. This fixes the only remaining conformance-suite failure on `callables_subtyping.py`. ## Test Plan mdtests --------- Co-authored-by: Claude <noreply@anthropic.com>
Author
Parents
Loading