We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bac9984 commit 02c07c8Copy full SHA for 02c07c8
test-data/unit/check-namedtuple.test
@@ -1460,3 +1460,17 @@ Func = NamedTuple('Func', [
1460
])
1461
[builtins fixtures/tuple.pyi]
1462
[typing fixtures/typing-namedtuple.pyi]
1463
+
1464
+[case testGenericNamedTupleRecursiveBound]
1465
+from typing import Generic, NamedTuple, TypeVar
1466
+T = TypeVar("T", bound="NT")
1467
+class NT(NamedTuple, Generic[T]):
1468
+ parent: T
1469
+ item: int
1470
1471
+def main(n: NT[T]) -> None:
1472
+ reveal_type(n.parent) # N: Revealed type is "T`-1"
1473
+ reveal_type(n.item) # N: Revealed type is "builtins.int"
1474
1475
+[builtins fixtures/tuple.pyi]
1476
+[typing fixtures/typing-namedtuple.pyi]
0 commit comments