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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java

Issue 179783007: Fix for 15001. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: 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 6d89357c5cd3dba0e87a6e9c38308e885e853087..b03e9f4db4de4939626004a775e0e82db2e38b64 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
@@ -470,11 +470,14 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
checkForMemberWithClassName();
checkForNoDefaultSuperConstructorImplicit(node);
- checkForAllMixinErrorCodes(withClause);
checkForConflictingTypeVariableErrorCodes(node);
- if (implementsClause != null || extendsClause != null) {
+ // Only do error checks on the clause nodes if there is a non-null clause
+ if (implementsClause != null || extendsClause != null || withClause != null) {
+ // Only check for all of the inheritance logic around clauses if there isn't an error code
+ // such as "Cannot extend double" already on the class.
if (!checkForImplementsDisallowedClass(implementsClause)
- && !checkForExtendsDisallowedClass(extendsClause)) {
+ && !checkForExtendsDisallowedClass(extendsClause)
+ && !checkForAllMixinErrorCodes(withClause)) {
checkForNonAbstractClassInheritsAbstractMember(node);
checkForInconsistentMethodInheritance();
checkForRecursiveInterfaceInheritance(enclosingClass);
@@ -2984,12 +2987,12 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
* @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
*/
- private boolean checkForExtendsDisallowedClass(ExtendsClause extendsClause) {
- if (extendsClause == null) {
+ private boolean checkForExtendsDisallowedClass(ExtendsClause node) {
+ if (node == null) {
return false;
}
return checkForExtendsOrImplementsDisallowedClass(
- extendsClause.getSuperclass(),
+ node.getSuperclass(),
CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS);
}
@@ -3210,12 +3213,12 @@ public class ErrorVerifier extends RecursiveAstVisitor<Void> {
* @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS
*/
- private boolean checkForImplementsDisallowedClass(ImplementsClause implementsClause) {
- if (implementsClause == null) {
+ private boolean checkForImplementsDisallowedClass(ImplementsClause node) {
+ if (node == null) {
return false;
}
boolean foundError = false;
- for (TypeName type : implementsClause.getInterfaces()) {
+ for (TypeName type : node.getInterfaces()) {
foundError = foundError
| checkForExtendsOrImplementsDisallowedClass(
type,

Powered by Google App Engine
This is Rietveld 408576698