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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/Resolver.java

Issue 10961058: Issue 5302. Type alias type parameters should not conflict with formal parameters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 05157b2cbc2e1bc819c683871cdbb4f83bf9af0f..53744cce380273228067eb664da637595fb9f371 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -244,21 +244,24 @@ public class Resolver {
getContext().pushFunctionAliasScope(alias);
resolveFunctionAlias(alias);
- List<DartParameter> parameters = alias.getParameters();
- for (DartParameter parameter : parameters) {
- assert parameter.getElement() != null;
- if (parameter.getQualifier() instanceof DartThisExpression) {
- onError(parameter.getName(), ResolverErrorCode.PARAMETER_INIT_OUTSIDE_CONSTRUCTOR);
- } else {
- if (parameter.getModifiers().isNamed()
- && DartIdentifier.isPrivateName(parameter.getElement().getName())) {
- onError(parameter.getName(),
- ResolverErrorCode.NAMED_PARAMETERS_CANNOT_START_WITH_UNDER);
+ getContext().pushScope("<parameters>");
+ try {
+ List<DartParameter> parameters = alias.getParameters();
+ for (DartParameter parameter : parameters) {
+ assert parameter.getElement() != null;
+ if (parameter.getQualifier() instanceof DartThisExpression) {
+ onError(parameter.getName(), ResolverErrorCode.PARAMETER_INIT_OUTSIDE_CONSTRUCTOR);
+ } else {
+ 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);
}
- getContext().declare(
- parameter.getElement(),
- ResolverErrorCode.DUPLICATE_PARAMETER);
}
+ } finally {
+ getContext().popScope();
}
getContext().popScope();
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698