See this typing conformance test:
@dataclass
class DC6:
x: int
y: ClassVar[int] = 1
@dataclass
class DC7(DC6):
# This should generate an error because a ClassVar cannot override
# an instance variable of the same name.
x: ClassVar[int] # E
# This should generate an error because an instance variable cannot
# override a class variable of the same name.
y: int # E
This isn't actually specific to dataclasses, and should be implemented as a general Liskov check. This is also listed in #2158, but I wanted to have a separate issue that we can label as conformance / prioritize independently.
See this typing conformance test:
This isn't actually specific to dataclasses, and should be implemented as a general Liskov check. This is also listed in #2158, but I wanted to have a separate issue that we can label as
conformance/ prioritize independently.