@@ -65,6 +65,19 @@ library;
65
65
// extension type E10(num foo, bool bar, double baz) {} // Error.
66
66
// ^
67
67
//
68
+ // pkg/front_end/testcases/extension_types/representation_field_error.dart:15:28: Error: The representation field can't have a trailing comma.
69
+ // extension type E11(bool foo,) {} // Error.
70
+ // ^
71
+ //
72
+ // pkg/front_end/testcases/extension_types/representation_field_error.dart:16:29: Error: Non-optional parameters can't have a default value.
73
+ // Try removing the default value or making the parameter optional.
74
+ // extension type E12(bool foo = false,) {} // Error.
75
+ // ^
76
+ //
77
+ // pkg/front_end/testcases/extension_types/representation_field_error.dart:16:36: Error: The representation field can't have a trailing comma.
78
+ // extension type E12(bool foo = false,) {} // Error.
79
+ // ^
80
+ //
68
81
import self as self;
69
82
import "dart:core" as core;
70
83
@@ -120,6 +133,16 @@ extension type E10(core::num foo) {
120
133
constructor • = self::E10|constructor#;
121
134
constructor tearoff • = self::E10|constructor#_#new#tearOff;
122
135
}
136
+ extension type E11(core::bool foo) {
137
+ abstract inline-class-member representation-field get foo() → core::bool;
138
+ constructor • = self::E11|constructor#;
139
+ constructor tearoff • = self::E11|constructor#_#new#tearOff;
140
+ }
141
+ extension type E12(core::bool foo) {
142
+ abstract inline-class-member representation-field get foo() → core::bool;
143
+ constructor • = self::E12|constructor#;
144
+ constructor tearoff • = self::E12|constructor#_#new#tearOff;
145
+ }
123
146
static inline-class-member method E1|constructor#(dynamic foo) → self::E1 /* = dynamic */ {
124
147
lowered final self::E1 /* = dynamic */ #this = foo;
125
148
return #this;
@@ -180,3 +203,19 @@ static inline-class-member method E10|constructor#(core::num foo, core::bool bar
180
203
}
181
204
static inline-class-member method E10|constructor#_#new#tearOff(core::num foo, core::bool bar, core::double baz) → self::E10 /* = core::num */
182
205
return self::E10|constructor#(foo, bar, baz);
206
+ static inline-class-member method E11|constructor#(core::bool foo) → self::E11 /* = core::bool */ {
207
+ lowered final self::E11 /* = core::bool */ #this = foo;
208
+ return #this;
209
+ }
210
+ static inline-class-member method E11|constructor#_#new#tearOff(core::bool foo) → self::E11 /* = core::bool */
211
+ return self::E11|constructor#(foo);
212
+ static inline-class-member method E12|constructor#(core::bool foo = #C1) → self::E12 /* = core::bool */ {
213
+ lowered final self::E12 /* = core::bool */ #this = foo;
214
+ return #this;
215
+ }
216
+ static inline-class-member method E12|constructor#_#new#tearOff(has-declared-initializer core::bool foo) → self::E12 /* = core::bool */
217
+ return self::E12|constructor#(foo);
218
+
219
+ constants {
220
+ #C1 = false
221
+ }
0 commit comments