Issue 7469. Report error if type appears in for extends and implements clauses

http://code.google.com/p/dart/issues/detail?id=7469

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//11612027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16282 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
scheglov@google.com
2012-12-18 19:49:12 +00:00
parent 338335ae1c
commit a3dcd4e8f8
4 changed files with 20 additions and 1 deletions
@@ -197,6 +197,7 @@ public enum ResolverErrorCode implements ErrorCode {
RETHROW_NOT_IN_CATCH("Re-throw not in a catch block"),
STATIC_FINAL_REQUIRES_VALUE("Static final fields must have an initial value"),
STATIC_METHOD_MUST_HAVE_BODY("Static method must have a body"),
SUPER_CLASS_IN_IMPLEMENTS("Superclass in implements clause"),
SUPER_IN_FACTORY_CONSTRUCTOR("Cannot use 'super' in a factory constructor"),
SUPER_IN_STATIC_METHOD("Cannot use 'super' in a static method"),
SUPER_OUTSIDE_OF_METHOD("Cannot use 'super' outside of a method"),
@@ -4,6 +4,7 @@
package com.google.dart.compiler.resolver;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.google.dart.compiler.DartCompilerContext;
@@ -111,6 +112,10 @@ public class SupertypeResolver {
topLevelContext.onError(intNode, ResolverErrorCode.DUPLICATE_IMPLEMENTS_TYPE);
continue;
}
if (Objects.equal(intType, supertype)) {
topLevelContext.onError(intNode, ResolverErrorCode.SUPER_CLASS_IN_IMPLEMENTS);
continue;
}
seenImplement.add(intType);
}
// OK, add