Skip to content

Commit

Permalink
Fix test failures caused by merge race (#10925)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Aug 4, 2021
1 parent 7438158 commit d7fabc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test-data/unit/check-isinstance.test
Original file line number Diff line number Diff line change
Expand Up @@ -2377,19 +2377,19 @@ class B:

def t1(self) -> None:
if isinstance(self, A1):
reveal_type(self) # N: Revealed type is '__main__.<subclass of "A1" and "B">'
reveal_type(self) # N: Revealed type is "__main__.<subclass of "A1" and "B">"
x0: Literal[0] = self.f() # E: Incompatible types in assignment (expression has type "Literal[1]", variable has type "Literal[0]")
x1: Literal[1] = self.f()

def t2(self) -> None:
if isinstance(self, (A0, A1)): # E: Subclass of "B" and "A0" cannot exist: would have incompatible method signatures
reveal_type(self) # N: Revealed type is '__main__.<subclass of "A1" and "B">1'
reveal_type(self) # N: Revealed type is "__main__.<subclass of "A1" and "B">1"
x0: Literal[0] = self.f() # E: Incompatible types in assignment (expression has type "Literal[1]", variable has type "Literal[0]")
x1: Literal[1] = self.f()

def t3(self) -> None:
if isinstance(self, (A1, A2)):
reveal_type(self) # N: Revealed type is 'Union[__main__.<subclass of "A1" and "B">2, __main__.<subclass of "A2" and "B">]'
reveal_type(self) # N: Revealed type is "Union[__main__.<subclass of "A1" and "B">2, __main__.<subclass of "A2" and "B">]"
x0: Literal[0] = self.f() # E: Incompatible types in assignment (expression has type "Union[Literal[1], Literal[2]]", variable has type "Literal[0]")
x1: Literal[1] = self.f() # E: Incompatible types in assignment (expression has type "Union[Literal[1], Literal[2]]", variable has type "Literal[1]")

Expand Down

0 comments on commit d7fabc9

Please sign in to comment.