Open eltoder opened 1 year ago
Adding reveal_type
calls to the example confirms that mypy is picking a different overload with the alias-to-Any version: https://mypy-play.net/?mypy=latest&python=3.11&flags=strict&gist=8b3429d9daae0e46ebc64d5aae592513
Bug Report
Overload resolution appears to pick the first matching overload if the argument type is an alias to Any. It should consider all overloads. This works correctly when using Any directly (without an alias). This came up in https://github.com/python/typeshed/issues/10405.
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.11&flags=strict&gist=26e08b7414caad553cd0e9549928da11
Expected Behavior
Both
call_any
andcall_alias
should type check without errors, since they are the same thing.Actual Behavior
call_alias
produces an error in strict mode:Your Environment