You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect this program to typecheck successfull (or error for both __mul__ and __rmul__)
Actual Behavior
main.py:22: error: Signatures of "__rmul__" of "Unit" and "__mul__" of "Unit | int" are unsafely overlapping [misc]
main.py:22: error: Signatures of "__rmul__" of "Unit" and "__mul__" of "Unit | Decimal" are unsafely overlapping [misc]
Found 2 errors in 1 file (checked 1 source file)
The text was updated successfully, but these errors were encountered:
Bug Report
When attempting to add overrides to the
__mul__
and__rmul__
magic methods, different behaviour is observed for the same set of overrides.This seems similar to the issue in #10755, but that has since been fixed.
To Reproduce
Playground link: https://mypy-play.net/?mypy=latest&python=3.12&gist=1297febcc3b38a2eea422e7073842c31
(Note that this playground is for the latest version (1.14.1), but the same errors are observed on
master
)Sample program:
Expected Behavior
I expect this program to typecheck successfull (or error for both
__mul__
and__rmul__
)Actual Behavior
The text was updated successfully, but these errors were encountered: