File tree 1 file changed +11
-0
lines changed
pkg/_fe_analyzer_shared/lib/src/macros/api 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ final class NamedTypeAnnotationCode extends TypeAnnotationCode {
203
203
final class FunctionTypeAnnotationCode extends TypeAnnotationCode {
204
204
final List <ParameterCode > namedParameters;
205
205
206
+ final List <ParameterCode > optionalPositionalParameters;
207
+
206
208
final List <ParameterCode > positionalParameters;
207
209
208
210
final TypeAnnotationCode ? returnType;
@@ -226,6 +228,14 @@ final class FunctionTypeAnnotationCode extends TypeAnnotationCode {
226
228
positional,
227
229
', ' ,
228
230
],
231
+ if (optionalPositionalParameters.isNotEmpty) ...[
232
+ '[' ,
233
+ for (ParameterCode optional in optionalPositionalParameters) ...[
234
+ optional,
235
+ ', ' ,
236
+ ],
237
+ ']' ,
238
+ ],
229
239
if (namedParameters.isNotEmpty) ...[
230
240
'{' ,
231
241
for (ParameterCode named in namedParameters) ...[
@@ -239,6 +249,7 @@ final class FunctionTypeAnnotationCode extends TypeAnnotationCode {
239
249
240
250
FunctionTypeAnnotationCode ({
241
251
this .namedParameters = const [],
252
+ this .optionalPositionalParameters = const [],
242
253
this .positionalParameters = const [],
243
254
this .returnType,
244
255
this .typeParameters = const [],
You can’t perform that action at this time.
0 commit comments