-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normal
Description
class A: pass
B: Type[A]
reveal_type(B) # E: Revealed type is 'Type[__main__.A]'
B = A
reveal_type(B) # E: Revealed type is 'builtins.None'
b = B() # E: None not callableCommentary from @pkch :
it seems the problem is that reveal_type calls meet_simple() on Type[A] and A, which are represented as TypeType and Callable. And meet_simple logic doesn't notice that they are compatible, so it returns None. I'm not sure what the difference is between meet_simple and meet_type, but the two would behave identically in this situation.
Attn @ilevkivskyi, who is hanging out in this area of code I think.
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-normal