Overloaded generic constructors can cause spurious errors in class methods #7935
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-overloads
topic-type-variables
This fails, while it shouldn't:
I think the same also will happen with
__init__()
. The problem is because the return type of the first overload is always passed as an instance type toanalyze_class_attribute_access()
.Note: enabling test case
testGenericClassInGenericFunctionOverloadedConstructor
is blocked on this.The text was updated successfully, but these errors were encountered: