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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12045015: Disallow mixing in classes where the superclass != Object. (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: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 345146728173be447d30b7d899df37f8fa7f3e52..2f5602e3715600c7205335fac71e26ea4a1fffda 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -497,8 +497,8 @@ class ResolverTask extends CompilerTask {
}
}
- void checkMixinApplication(MixinApplicationElement mixin) {
- Modifiers modifiers = mixin.modifiers;
+ void checkMixinApplication(MixinApplicationElement mixinApplication) {
+ Modifiers modifiers = mixinApplication.modifiers;
int illegalFlags = modifiers.flags & ~Modifiers.FLAG_ABSTRACT;
if (illegalFlags != 0) {
Modifiers illegalModifiers = new Modifiers.withFlags(null, illegalFlags);
@@ -508,6 +508,13 @@ class ResolverTask extends CompilerTask {
compiler.reportMessage(compiler.spanFromSpannable(modifiers),
error, Diagnostic.ERROR);
}
+
+ ClassElement mixin = mixinApplication.mixin;
+ if (!mixin.superclass.isObject(compiler)) {
+ CompilationError error = MessageKind.ILLEGAL_MIXIN_SUPERCLASS.error();
+ compiler.reportMessage(compiler.spanFromElement(mixin),
+ error, Diagnostic.ERROR);
+ }
}
void checkClassMembers(ClassElement cls) {

Powered by Google App Engine
This is Rietveld 408576698