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

Unified Diff: lib/kernel_visitor.dart

Issue 2055213002: Fix crash on mandatory parameters with initializers. (Closed) Base URL: git@github.com:dart-lang/rasta.git@for_in
Patch Set: Created 4 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 | test/kernel/regression/mandatory_parameter_initializer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/kernel_visitor.dart
diff --git a/lib/kernel_visitor.dart b/lib/kernel_visitor.dart
index 82f9518d33db963a40b803f8d0e713f428637999..b2ca9b667531beeba9f98b0f5875701dfbc78ac6 100644
--- a/lib/kernel_visitor.dart
+++ b/lib/kernel_visitor.dart
@@ -2084,6 +2084,7 @@ class KernelVisitor extends Object
}
});
signature.forEachParameter((ParameterElement parameter) {
+ if (!parameter.isOptional) return;
ir.Expression initializer = parameter.initializer?.accept(this);
ir.VariableDeclaration variable = getLocal(parameter);
if (initializer != null) {
« no previous file with comments | « no previous file | test/kernel/regression/mandatory_parameter_initializer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698