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

Unified Diff: runtime/vm/parser.cc

Issue 2139003002: Tighten check disallowing use of initializing formals (fixes #26855). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « runtime/vm/parser.h ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 80493f29a304f8b34530a57165bf39cecde6d6eb..6af310070ea1e24b478bda2aff4811f1104355cc 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -7397,6 +7397,12 @@ void Parser::AddFormalParamsToFunction(const ParamList* params,
ParamDesc& param_desc = (*params->parameters)[i];
func.SetParameterTypeAt(i, *param_desc.type);
func.SetParameterNameAt(i, *param_desc.name);
+ if (param_desc.is_field_initializer && !func.IsGenerativeConstructor()) {
+ // Redirecting constructors are detected later in ParseConstructor.
+ ReportError(param_desc.name_pos,
+ "only generative constructors may have "
+ "initializing formal parameters");
+ }
}
}
« no previous file with comments | « runtime/vm/parser.h ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698