Skip to content

Commit dbfd0f3

Browse files
committed
Additional incremental test cases which are not really required.
1 parent 0d5b8a9 commit dbfd0f3

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

test-data/unit/check-incremental.test

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5447,6 +5447,59 @@ tmp/c.py:2: note: Revealed type is "Any"
54475447
[out2]
54485448
tmp/c.py:2: note: Revealed type is "a.<subclass of "a.A" and "a.B">"
54495449

5450+
[case testIsInstanceAdHocIntersectionIncrementalNestedClass]
5451+
import b
5452+
[file a.py]
5453+
class A:
5454+
class B: ...
5455+
class C: ...
5456+
class D:
5457+
def __init__(self) -> None:
5458+
x: A.B
5459+
assert isinstance(x, A.C)
5460+
self.x = x
5461+
[file b.py]
5462+
from a import A
5463+
[file b.py.2]
5464+
from a import A
5465+
reveal_type(A.D.x)
5466+
[builtins fixtures/isinstance.pyi]
5467+
[out]
5468+
[out2]
5469+
tmp/b.py:2: note: Revealed type is "a.<subclass of "a.A.B" and "a.A.C">"
5470+
5471+
[case testIsInstanceAdHocIntersectionIncrementalUnions]
5472+
import c
5473+
[file a.py]
5474+
import b
5475+
class A:
5476+
p: b.D
5477+
class B:
5478+
p: b.D
5479+
class C:
5480+
p: b.D
5481+
c: str
5482+
x: A
5483+
assert isinstance(x, (B, C))
5484+
y = x
5485+
[file b.py]
5486+
class D:
5487+
p: int
5488+
[file c.py]
5489+
from a import y
5490+
[file c.py.2]
5491+
from a import y, C
5492+
reveal_type(y)
5493+
reveal_type(y.p.p)
5494+
assert isinstance(y, C)
5495+
reveal_type(y.c)
5496+
[builtins fixtures/isinstance.pyi]
5497+
[out]
5498+
[out2]
5499+
tmp/c.py:2: note: Revealed type is "Union[a.<subclass of "a.A" and "a.B">, a.<subclass of "a.A" and "a.C">]"
5500+
tmp/c.py:3: note: Revealed type is "builtins.int"
5501+
tmp/c.py:5: note: Revealed type is "builtins.str"
5502+
54505503
[case testStubFixupIssues]
54515504
import a
54525505
[file a.py]

0 commit comments

Comments
 (0)