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

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

Issue 10515012: Fix for issues 2380 and 2381 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
===================================================================
--- compiler/java/com/google/dart/compiler/resolver/Resolver.java (revision 8249)
+++ compiler/java/com/google/dart/compiler/resolver/Resolver.java (working copy)
@@ -224,6 +224,23 @@
public Element visitFunctionTypeAlias(DartFunctionTypeAlias alias) {
getContext().pushFunctionAliasScope(alias);
resolveFunctionAlias(alias);
+
+ List<DartParameter> parameters = alias.getParameters();
+ for (DartParameter parameter : parameters) {
+ assert parameter.getElement() != null;
+ if (parameter.getQualifier() instanceof DartThisExpression) {
zundel 2012/06/04 19:23:18 There is also the case 'super'. In fact, I'm not
Brian Wilkerson 2012/06/04 19:32:39 No, it isn't. But as far as I can see the parser w
+ onError(parameter.getName(), ResolverErrorCode.PARAMETER_INIT_OUTSIDE_CONSTRUCTOR);
+ } else {
+ getContext().declare(
+ parameter.getElement(),
+ ResolverErrorCode.DUPLICATE_PARAMETER,
+ ResolverErrorCode.DUPLICATE_PARAMETER_WARNING);
+ }
+ if (parameter.getDefaultExpr() != null) {
+ onError(parameter.getDefaultExpr(), ResolverErrorCode.DEFAULT_VALUE_IN_TYPEDEF);
+ }
+ }
+
getContext().popScope();
return null;
}

Powered by Google App Engine
This is Rietveld 408576698