Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive: signature incompatible with supertype if subtype has overloads #14725

Closed
gsakkis opened this issue Feb 17, 2023 · 1 comment
Closed
Labels
bug mypy got something wrong

Comments

@gsakkis
Copy link

gsakkis commented Feb 17, 2023

Bug Report

This is similar to #13106 but the method is @overloaded in the subtype instead of the supertype.

To Reproduce
playground link

Actual Behavior

main.py:11: error: Signature of "f" incompatible with supertype "Parent"  [override]
main.py:11: note:      Superclass:
main.py:11: note:          def f(self, i: Union[int, slice]) -> Any
main.py:11: note:      Subclass:
main.py:11: note:          @overload
main.py:11: note:          def f(self, i: int) -> Any
main.py:11: note:          @overload
main.py:11: note:          def f(self, i: slice) -> Any
Found 1 error in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 1.0.0
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 3.8.16
@sterliakov
Copy link
Contributor

Duplicate of #12379?

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants