@@ -29,12 +29,18 @@ void main() {
2929 Expect .identical (EnumPlainSemicolon .v3, EnumPlainSemicolon .values[2 ]);
3030
3131 Expect .equals (3 , EnumPlainTrailingCommaSemicolon .values.length);
32- Expect .identical (EnumPlainTrailingCommaSemicolon .v1,
33- EnumPlainTrailingCommaSemicolon .values[0 ]);
34- Expect .identical (EnumPlainTrailingCommaSemicolon .v2,
35- EnumPlainTrailingCommaSemicolon .values[1 ]);
36- Expect .identical (EnumPlainTrailingCommaSemicolon .v3,
37- EnumPlainTrailingCommaSemicolon .values[2 ]);
32+ Expect .identical (
33+ EnumPlainTrailingCommaSemicolon .v1,
34+ EnumPlainTrailingCommaSemicolon .values[0 ],
35+ );
36+ Expect .identical (
37+ EnumPlainTrailingCommaSemicolon .v2,
38+ EnumPlainTrailingCommaSemicolon .values[1 ],
39+ );
40+ Expect .identical (
41+ EnumPlainTrailingCommaSemicolon .v3,
42+ EnumPlainTrailingCommaSemicolon .values[2 ],
43+ );
3844
3945 Expect .equals (6 , EnumAll .values.length);
4046 Expect .identical (EnumAll .v1, EnumAll .values[0 ]);
@@ -105,7 +111,9 @@ void main() {
105111 Expect .identical (EnumAll .v4, EnumAll .v3 ^ EnumAll .v2);
106112
107113 Expect .equals (
108- "EnumAll.v1:EnumMixin<num>:ObjectMixin:this" , EnumAll .v1.thisAndSuper ());
114+ "EnumAll.v1:EnumMixin<num>:ObjectMixin:this" ,
115+ EnumAll .v1.thisAndSuper (),
116+ );
109117
110118 // Which can reference type parameters.
111119 Expect .isTrue (EnumAll .v2.test (2 )); // does `is T` with `T` being `int`.
@@ -148,35 +156,22 @@ void main() {
148156enum EnumPlain { v1, v2, v3 }
149157
150158// Also with trailing comma.
151- enum EnumPlainTrailingComma {
152- v1,
153- v2,
154- v3,
155- }
159+ enum EnumPlainTrailingComma { v1, v2, v3 }
156160
157161// Also if using type parameters, mixins or interfaces.
158162// It only matters whether there is something after the values.
159163enum EnumNoSemicolon <T extends num > with ObjectMixin implements Interface {
160164 v1,
161165 v2,
162- v3
166+ v3,
163167}
164168
165169// Allows semicolon after values, even when not needed.
166170// Without trailing comma.
167- enum EnumPlainSemicolon {
168- v1,
169- v2,
170- v3;
171- }
171+ enum EnumPlainSemicolon { v1, v2, v3 }
172172
173173// With trailing comma.
174- enum EnumPlainTrailingCommaSemicolon {
175- v1,
176- v2,
177- v3,
178- ;
179- }
174+ enum EnumPlainTrailingCommaSemicolon { v1, v2, v3 }
180175
181176// Full syntax, with every possible option.
182177@EnumAll .v1
@@ -193,8 +188,7 @@ enum EnumAll<S extends num, T extends num>
193188 v3 <int , int >(y: 2 ),
194189 v4.named (1 , y: 2 ),
195190 v5< int , int > .renamed (1 , y: 2 ),
196- v6.new (),
197- ;
191+ v6.new ();
198192
199193 /// Static members.
200194 ///
@@ -216,16 +210,16 @@ enum EnumAll<S extends num, T extends num>
216210 // Constructors.
217211 // Generative, non-redirecting, unnamed.
218212 const EnumAll ({T ? y})
219- : constructor = "unnamed" ,
220- this .x = 0 as S ,
221- y = y ?? (0 as T );
213+ : constructor = "unnamed" ,
214+ this .x = 0 as S ,
215+ y = y ?? (0 as T );
222216 // Generative, non-redirecting, named.
223217 const EnumAll .named (this .x, {T ? y, String ? constructor})
224- : constructor = constructor ?? "named" ,
225- y = y ?? (0 as T );
218+ : constructor = constructor ?? "named" ,
219+ y = y ?? (0 as T );
226220 // Generative, redirecting.
227221 const EnumAll .renamed (S x, {T ? y})
228- : this .named (x, y: y, constructor: "renamed" );
222+ : this .named (x, y: y, constructor: "renamed" );
229223 // Factory, non-redirecting.
230224 factory EnumAll .factory (int index) => values[index] as EnumAll <S , T >;
231225 // Factory, redirecting (only to other factory constructor).
0 commit comments