Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java |
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
index 9049790b02483c6bac91bd70f1b63bffcc3e260b..7b88ed146532d7e4709e6eb3e1b02ef4297ea07c 100644 |
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
@@ -231,10 +231,15 @@ public class Resolver { |
if (parameter.getQualifier() instanceof DartThisExpression) { |
onError(parameter.getName(), ResolverErrorCode.PARAMETER_INIT_OUTSIDE_CONSTRUCTOR); |
} else { |
- getContext().declare( |
- parameter.getElement(), |
- ResolverErrorCode.DUPLICATE_PARAMETER, |
- ResolverErrorCode.DUPLICATE_PARAMETER_WARNING); |
+ if (parameter.getModifiers().isNamed() |
+ && DartIdentifier.isPrivateName(parameter.getElement().getName())) { |
+ onError(parameter.getName(), |
+ ResolverErrorCode.NAMED_PARAMETERS_CANNOT_START_WITH_UNDER); |
+ } |
+ getContext().declare( |
+ parameter.getElement(), |
+ ResolverErrorCode.DUPLICATE_PARAMETER, |
+ ResolverErrorCode.DUPLICATE_PARAMETER_WARNING); |
} |
if (parameter.getDefaultExpr() != null) { |
onError(parameter.getDefaultExpr(), ResolverErrorCode.DEFAULT_VALUE_IN_TYPEDEF); |
@@ -597,6 +602,7 @@ public class Resolver { |
// scope of the default expressions so we can report better errors. |
for (DartParameter parameter : parameters) { |
assert parameter.getElement() != null; |
+ |
if (!(parameter.getQualifier() instanceof DartThisExpression)) { |
getContext().declare( |
parameter.getElement(), |