Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_schema_elimination.dart

Issue 2965123002: Fix greatest/least closure computation when there are multiple `?`s. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/type_inference/type_schema_elimination_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/type_inference/type_schema_elimination_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698