Inheriting from NamedTuple causes "Overloaded function signatures 1 and 2 overlap with incompatible return types" #18562
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
topic-named-tuple
topic-overloads
Bug Report
When two classes inherit from NamedTuple, I get an overlap error when I want to overload based on their type.
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.12&gist=38e025ef049b6a1121cdd92c998e84a9
Expected Behavior
I expect this to not cause an error. It does not report an error if A and B inherit from tuple, dict or object instead.
Actual Behavior
error: Overloaded function signatures 1 and 2 overlap with incompatible return types [overload-overlap]
Your Environment
mypy.ini
(and other config files): (playground)The text was updated successfully, but these errors were encountered: