Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java |
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
index 7b115dd3796bed81aa0cb768fc8019406db8a75a..f85ccd538e2eb04a2a9491ffdf567437bc38777e 100644 |
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
@@ -373,6 +373,7 @@ public class Resolver { |
onError(errorTarget, ResolverErrorCode.CYCLIC_CLASS, e.getElement().getName()); |
} |
checkMixinNoConstructors(cls.getMixins()); |
+ checkMixinNoSuperInvocations(cls.getMixins()); |
return classElement; |
} |
@@ -488,8 +489,9 @@ public class Resolver { |
} |
} |
- // check that mixin types don't have constructors |
+ // check mixins |
checkMixinNoConstructors(cls.getMixins()); |
+ checkMixinNoSuperInvocations(cls.getMixins()); |
context = previousContext; |
currentHolder = previousHolder; |
@@ -513,6 +515,24 @@ public class Resolver { |
} |
} |
} |
+ |
+ /** |
+ * Checks that the types of the given mixin type node don't have super invocations. |
+ */ |
+ private void checkMixinNoSuperInvocations(List<DartTypeNode> mixins) { |
+ for (DartTypeNode mixNode : mixins) { |
+ if (mixNode.getType() instanceof InterfaceType) { |
+ InterfaceType mixType = (InterfaceType) mixNode.getType(); |
+ if (mixType.getElement() instanceof ClassElement) { |
+ ClassElement mixElement = (ClassElement) mixType.getElement(); |
+ if (mixElement.hasSuperInvocation()) { |
+ topLevelContext.onError(mixNode, ResolverErrorCode.CANNOT_MIXIN_CLASS_WITH_SUPER); |
+ break; |
+ } |
+ } |
+ } |
+ } |
+ } |
private void constVerifyMembers(Iterable<? extends Element> members, ClassElement originalClass, |
ClassElement currentClass) { |