Incompatible override when overriding non-overload with overload #12379
Labels
bug
mypy got something wrong
topic-inheritance
Inheritance and incompatible overrides
topic-overloads
https://mypy-play.net/?mypy=latest&python=3.10&gist=37c2291afd7ddd170576b1de208ba77c
produces:
But as far as I can see this is safe. Mypy accepts a union as an argument to
B.f
:Of course, the overloads are useless in this toy example, but the error also comes up if you vary the return type in the overloads. This came up in python/typeshed#7510.
The text was updated successfully, but these errors were encountered: