-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-union-types
Description
This test case:
[case testSelfTypeClassMethodOnUnion]
from typing import Type, Union, TypeVar
T = TypeVar('T')
class A:
@classmethod
def meth(cls: Type[T]) -> T: ...
class B(A): ...
class C(A): ...
t: Type[Union[B, C]]
x = t.meth()
reveal_type(x)
[builtins fixtures/classmethod.pyi]
fails with
main:12: error: Need type annotation for 'x'
main:13: note: Revealed type is 'Any'
while the type should clearly be Union[B, C].
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-union-types