-
Notifications
You must be signed in to change notification settings - Fork 285
Closed
Labels
googleissues from googleissues from googletypecheckingv1-consider-addingTop-ranked but not in V1 milestone (consider adding)Top-ranked but not in V1 milestone (consider adding)
Milestone
Description
import dataclasses
from typing import ClassVar
@dataclasses.dataclass(frozen=True)
class _Test:
x: ClassVar[bool] = True
def some(self) -> None:
self.__class__.x = FalseProduces:
» pyrefly check
INFO Checking project configured at `pyproject.toml`
ERROR Cannot set field `x` [read-only]
--> test.py:8:9
|
23 | self.__class__.x = False
| ^^^^^^^^^^^^^^^^
|
This field is a frozen dataclass member
However, this works in runtime.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
googleissues from googleissues from googletypecheckingv1-consider-addingTop-ranked but not in V1 milestone (consider adding)Top-ranked but not in V1 milestone (consider adding)