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

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2957583003: Fix computation of default values for named parameters. (Closed)
Patch Set: Created 3 years, 6 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 | tests/compiler/dart2js/kernel/compile_from_dill_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 8238709d3051ced7f01cfe45e88ee96a9c12f13c..9fc1be611ce7de8a39ace6520164826ccf51a7f0 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -2264,7 +2264,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
}
/// Build argument list in canonical order for a static [target], including
- /// filling in the defaulted argument value.
+ /// filling in the default argument value.
List<HInstruction> _visitArgumentsForStaticTarget(
ir.FunctionNode target, ir.Arguments arguments) {
// Visit arguments in source order, then re-order and fill in defaults.
@@ -2276,7 +2276,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
values.add(_defaultValueForParameter(parameter));
}
- if (arguments.named.isNotEmpty) {
+ if (target.namedParameters.isNotEmpty) {
var namedValues = <String, HInstruction>{};
for (ir.NamedExpression argument in arguments.named) {
argument.value.accept(this);
@@ -2301,6 +2301,8 @@ class KernelSsaGraphBuilder extends ir.Visitor
}
}
assert(namedValues.isEmpty);
+ } else {
+ assert(arguments.named.isEmpty);
}
return values;
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/compile_from_dill_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698