mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
## Summary fixes: https://github.com/astral-sh/ty/issues/2027 This PR fixes a bug where the type mapping for a `ParamSpec` was not being applied in an overloaded function. This PR also fixes https://github.com/astral-sh/ty/issues/2081 and reveals new diagnostics which doesn't look related to the bug: ```py from prefect import flow, task @task def task_get() -> int: """Task get integer.""" return 42 @task def task_add(x: int, y: int) -> int: """Task add two integers.""" print(f"Adding {x} and {y}") return x + y @flow def my_flow(): """My flow.""" x = 23 future_y = task_get.submit() # error: [no-matching-overload] task_add(future_y, future_y) # error: [no-matching-overload] task_add(x, future_y) ``` The reason is that the type of `future_y` is `PrefectFuture[int]` while the type of `task_add` is `Task[(x: int, y: int), int]` which means that the assignment between `int` and `PrefectFuture[int]` fails which results in no overload matching. Pyright also raises the invalid argument type error on all three usages of `future_y` in those two calls. ## Test Plan Add regression mdtest from the linked issue.