Index: pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart |
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart |
index 0c96c24d49bf0691e3f661b68227972782dd4303..a5bb0eb183b6979f9ffc44b2121920f28926c215 100644 |
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart |
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart |
@@ -59,7 +59,7 @@ class _TypeSchemaEliminationVisitor extends TypeSchemaVisitor<DartType> { |
for (int i = 0; i < node.positionalParameters.length; i++) { |
DartType substitution = node.positionalParameters[i].accept(this); |
if (substitution != null) { |
- newPositionalParameters = |
+ newPositionalParameters ??= |
node.positionalParameters.toList(growable: false); |
newPositionalParameters[i] = substitution; |
} |
@@ -68,7 +68,7 @@ class _TypeSchemaEliminationVisitor extends TypeSchemaVisitor<DartType> { |
for (int i = 0; i < node.namedParameters.length; i++) { |
DartType substitution = node.namedParameters[i].type.accept(this); |
if (substitution != null) { |
- newNamedParameters = node.namedParameters.toList(growable: false); |
+ newNamedParameters ??= node.namedParameters.toList(growable: false); |
newNamedParameters[i] = |
new NamedType(node.namedParameters[i].name, substitution); |
} |