Skip to content

Commit 1ecd842

Browse files
committed
Add one more test case (just in case)
1 parent c6eff9d commit 1ecd842

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test-data/unit/check-incremental.test

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8012,6 +8012,32 @@ x = "hello"
80128012
[stale b]
80138013
[rechecked b]
80148014

8015+
[case testNamedTupleInlineBaseClassNoNameCollision]
8016+
import m
8017+
[file m.py]
8018+
from lib import A, B
8019+
a: A
8020+
b: B
8021+
reveal_type(a)
8022+
reveal_type(b)
8023+
[file m.py.2]
8024+
from lib import A, B
8025+
a: A
8026+
b: B
8027+
reveal_type(a) # touch
8028+
reveal_type(b)
8029+
[file lib.py]
8030+
from typing import NamedTuple
8031+
class A(NamedTuple("Same", [('x', int)])): pass
8032+
class B(NamedTuple("Same", [('x', str)])): pass
8033+
[builtins fixtures/tuple.pyi]
8034+
[out]
8035+
tmp/m.py:4: note: Revealed type is "tuple[builtins.int, fallback=lib.A]"
8036+
tmp/m.py:5: note: Revealed type is "tuple[builtins.str, fallback=lib.B]"
8037+
[out2]
8038+
tmp/m.py:4: note: Revealed type is "tuple[builtins.int, fallback=lib.A]"
8039+
tmp/m.py:5: note: Revealed type is "tuple[builtins.str, fallback=lib.B]"
8040+
80158041
[case testNamedTupleInlineBaseClassRedefined]
80168042
import m
80178043
[file m.py]

0 commit comments

Comments
 (0)