Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test-data/unit/check-dataclasses.test
Original file line number Diff line number Diff line change
Expand Up @@ -1685,3 +1685,15 @@ c: C[C]
d: C[str] # E: Type argument "str" of "C" must be a subtype of "C[Any]"
C(x=2)
[builtins fixtures/dataclasses.pyi]

[case testDataclassGenericBoundToInvalidTypeVarDoesNotCrash]
# flags: --python-version 3.7
import dataclasses
from typing import Generic, TypeVar

T = TypeVar("T", bound="NotDefined") # E: Name "NotDefined" is not defined

@dataclasses.dataclass
class C(Generic[T]):
x: float
[builtins fixtures/dataclasses.pyi]