bogus complaint when checking Callable arguments #18689
Labels
bug
mypy got something wrong
topic-type-context
Type context / bidirectional inference
topic-type-variables
Bug Report
mypy complains about correct code. it confuses the arguments to a Callable parameter with the return value of the function.
To Reproduce
https://gist.github.com/mypy-play/59b8705d6737e1f8f4855d7b2270e7e9
Expected Behavior
Code checks OK.
Actual Behavior
Bogus error:
Argument 1 to "test" has incompatible type "Callable[[str], bool]"; expected "Callable[[float | str], bool]" [arg-type]
Your Environment
mypy 1.15.0 (compiled: yes)
Python 3.13.2
The text was updated successfully, but these errors were encountered: