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

Unified Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 12051056: Allow native classes to mixin behavior from an ordinary Dart class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review feedback. 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/native_handler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 2eaa4af5f13df4d43059ebf794b00f8d0f6d48a7..ccef7f03af6babfdeab78a320107a769147fb1fe 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -439,8 +439,17 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
subtypes.add(cls);
}
+ // Skip through all the mixin applications in the super class
+ // chain. That way, the direct subtypes set only contain the
+ // natives classes.
+ ClassElement superclass = cls.superclass;
+ while (superclass != null && superclass.isMixinApplication) {
+ assert(!superclass.isNative());
+ superclass = superclass.superclass;
+ }
+
List<Element> directSubtypes = emitter.directSubtypes.putIfAbsent(
- cls.superclass,
+ superclass,
() => <ClassElement>[]);
directSubtypes.add(cls);
}

Powered by Google App Engine
This is Rietveld 408576698