Skip to content

Commit bbedae3

Browse files
committed
.
1 parent 29e77f1 commit bbedae3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test-data/unit/check-narrowing.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,9 +3026,15 @@ else:
30263026
class A:
30273027
def foo(self, x: object) -> None:
30283028
reveal_type(self) # N: Revealed type is "__main__.A"
3029+
reveal_type(x) # N: Revealed type is "builtins.object"
30293030
if type(self) is type(x):
30303031
reveal_type(self) # N: Revealed type is "__main__.A"
30313032
reveal_type(x) # N: Revealed type is "__main__.A"
3033+
if type(self) == type(x):
3034+
reveal_type(self) # N: Revealed type is "__main__.A"
3035+
reveal_type(x) # N: Revealed type is "__main__.A"
3036+
3037+
[builtins fixtures/primitives.pyi]
30323038

30333039
[case testNarrowInElseCaseIfFinal]
30343040
# flags: --strict-equality --warn-unreachable

0 commit comments

Comments
 (0)