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

Unified Diff: runtime/vm/parser.cc

Issue 10432010: Address review comments missed in previous change. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 7931)
+++ runtime/vm/parser.cc (working copy)
@@ -1034,13 +1034,14 @@
params->has_field_initializer = true;
}
- // Check that the formal parameter is not repeated.
+ // Check for duplicate formal parameters.
const intptr_t num_existing_parameters =
params->num_fixed_parameters + params->num_optional_parameters;
for (intptr_t i = 0; i < num_existing_parameters; i++) {
ParamDesc& existing_parameter = (*params->parameters)[i];
if (existing_parameter.name->Equals(*parameter.name)) {
- ErrorMsg(parameter.name_pos, "repeated formal parameter");
+ ErrorMsg(parameter.name_pos, "duplicate formal parameter '%s'",
+ parameter.name->ToCString());
}
}
@@ -3166,12 +3167,13 @@
index,
type_parameter_name,
token_index_);
- // Check that the type parameter is not repeated.
+ // Check for duplicate type parameters.
for (intptr_t i = 0; i < index; i++) {
existing_type_parameter ^= type_parameters_array.At(i);
existing_type_parameter_name = existing_type_parameter.Name();
if (existing_type_parameter_name.Equals(type_parameter_name)) {
- ErrorMsg("repeated type parameter");
+ ErrorMsg("duplicate type parameter '%s'",
+ type_parameter_name.ToCString());
}
}
ConsumeToken();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698