File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -3915,7 +3915,7 @@ def serialize(self) -> JsonDict:
3915
3915
"eq_default" : self .eq_default ,
3916
3916
"order_default" : self .order_default ,
3917
3917
"kw_only_default" : self .kw_only_default ,
3918
- "frozen_only_default " : self .frozen_default ,
3918
+ "frozen_default " : self .frozen_default ,
3919
3919
"field_specifiers" : list (self .field_specifiers ),
3920
3920
}
3921
3921
Original file line number Diff line number Diff line change @@ -90,3 +90,45 @@ builtins.pyi:12: note: "B" defined here
90
90
main:7: error: Unexpected keyword argument "y" for "B"
91
91
builtins.pyi:12: note: "B" defined here
92
92
==
93
+
94
+ [case frozenStays]
95
+ # flags: --python-version 3.11
96
+ from foo import Foo
97
+
98
+ foo = Foo(base=0, foo=1)
99
+
100
+ [file transform.py]
101
+ from typing import dataclass_transform, Type
102
+
103
+ @dataclass_transform(frozen_default=True)
104
+ def dataclass(cls: Type) -> Type: return cls
105
+
106
+ [file base.py]
107
+ from transform import dataclass
108
+
109
+ @dataclass
110
+ class Base:
111
+ base: int
112
+
113
+ [file foo.py]
114
+ from base import Base
115
+ from transform import dataclass
116
+
117
+ @dataclass
118
+ class Foo(Base):
119
+ foo: int
120
+
121
+ [file foo.py.2]
122
+ from base import Base
123
+ from transform import dataclass
124
+
125
+ @dataclass
126
+ class Foo(Base):
127
+ foo: int
128
+ bar: int = 0
129
+
130
+ [typing fixtures/typing-full.pyi]
131
+ [builtins fixtures/dataclasses.pyi]
132
+
133
+ [out]
134
+ ==
You can’t perform that action at this time.
0 commit comments