| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
|
| index c8941ec74ca37029f0c1378d682599f27fd35e1d..93a052dac8a9036fc70d4f8a97a65b73c4626701 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
|
| @@ -431,6 +431,7 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
|
| checkForFinalNotInitialized(node);
|
| checkForDuplicateDefinitionInheritance();
|
| checkForConflictingGetterAndMethod();
|
| + checkImplementsSuperClass(node);
|
| return super.visitClassDeclaration(node);
|
| } finally {
|
| initialFieldElementsMap = null;
|
| @@ -4296,6 +4297,39 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
|
| }
|
|
|
| /**
|
| + * This verifies that the given class declaration does not have the same class in the 'extends'
|
| + * and 'implements' clauses.
|
| + *
|
| + * @return {@code true} if and only if an error code is generated on the passed node
|
| + * @see CompileTimeErrorCode#IMPLEMENTS_SUPER_CLASS
|
| + */
|
| + private boolean checkImplementsSuperClass(ClassDeclaration node) {
|
| + // prepare super type
|
| + InterfaceType superType = enclosingClass.getSupertype();
|
| + if (superType == null) {
|
| + return false;
|
| + }
|
| + // prepare interfaces
|
| + ImplementsClause implementsClause = node.getImplementsClause();
|
| + if (implementsClause == null) {
|
| + return false;
|
| + }
|
| + // check interfaces
|
| + boolean hasProblem = false;
|
| + for (TypeName interfaceNode : implementsClause.getInterfaces()) {
|
| + if (interfaceNode.getType().equals(superType)) {
|
| + hasProblem = true;
|
| + errorReporter.reportError(
|
| + CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS,
|
| + interfaceNode,
|
| + superType.getDisplayName());
|
| + }
|
| + }
|
| + // done
|
| + return hasProblem;
|
| + }
|
| +
|
| + /**
|
| * Return the propagated type of the given expression, or the static type if there is no
|
| * propagated type information.
|
| *
|
|
|