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 17aec67 commit 613756bCopy full SHA for 613756b
test-data/unit/check-dataclasses.test
@@ -1712,3 +1712,15 @@ c: C[C]
1712
d: C[str] # E: Type argument "str" of "C" must be a subtype of "C[Any]"
1713
C(x=2)
1714
[builtins fixtures/dataclasses.pyi]
1715
+
1716
+[case testDataclassGenericBoundToInvalidTypeVarDoesNotCrash]
1717
+# flags: --python-version 3.7
1718
+import dataclasses
1719
+from typing import Generic, TypeVar
1720
1721
+T = TypeVar("T", bound="NotDefined") # E: Name "NotDefined" is not defined
1722
1723
+@dataclasses.dataclass
1724
+class C(Generic[T]):
1725
+ x: float
1726
+[builtins fixtures/dataclasses.pyi]
0 commit comments