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

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

Issue 12039054: Issue 8059. Disallow mixing in classes that use 'super' from any member. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/ClassElementImplementation.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java b/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
index 65aa64407bed9f11cc17bbf8413804149690d136..37dad0a1b39be2b853f2668b2c52989894e38553 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
@@ -5,6 +5,7 @@
package com.google.dart.compiler.resolver;
import com.google.common.collect.Lists;
+import com.google.dart.compiler.ast.ASTNodes;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartClassTypeAlias;
import com.google.dart.compiler.ast.DartDeclaration;
@@ -43,6 +44,7 @@ class ClassElementImplementation extends AbstractNodeElement implements ClassNod
private List<Element> unimplementedMembers;
private final int openBraceOffset;
private final int closeBraceOffset;
+ private final boolean hasSuperInvocation;
// declared volatile for thread-safety
@SuppressWarnings("unused")
@@ -73,6 +75,7 @@ class ClassElementImplementation extends AbstractNodeElement implements ClassNod
declarationNameWithTypeParameter = createDeclarationName(node.getName(), node.getTypeParameters());
openBraceOffset = node.getOpenBraceOffset();
closeBraceOffset = node.getCloseBraceOffset();
+ hasSuperInvocation = ASTNodes.hasSuperInvocation(node);
} else {
isInterface = false;
metadata = DartObsoleteMetadata.EMPTY;
@@ -81,6 +84,7 @@ class ClassElementImplementation extends AbstractNodeElement implements ClassNod
declarationNameWithTypeParameter = "";
openBraceOffset = -1;
closeBraceOffset = -1;
+ hasSuperInvocation = false;
}
}
@@ -97,6 +101,7 @@ class ClassElementImplementation extends AbstractNodeElement implements ClassNod
declarationNameWithTypeParameter = createDeclarationName(node.getName(), node.getTypeParameters());
openBraceOffset = -1;
closeBraceOffset = -1;
+ hasSuperInvocation = false;
} else {
isInterface = false;
metadata = DartObsoleteMetadata.EMPTY;
@@ -105,6 +110,7 @@ class ClassElementImplementation extends AbstractNodeElement implements ClassNod
declarationNameWithTypeParameter = "";
openBraceOffset = -1;
closeBraceOffset = -1;
+ hasSuperInvocation = false;
}
}
@@ -449,4 +455,9 @@ class ClassElementImplementation extends AbstractNodeElement implements ClassNod
public int getCloseBraceOffset() {
return closeBraceOffset;
}
+
+ @Override
+ public boolean hasSuperInvocation() {
+ return hasSuperInvocation;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698