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

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

Issue 12328035: Teach Selector.applies about mixins. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: sdk/lib/_internal/compiler/implementation/world.dart
diff --git a/sdk/lib/_internal/compiler/implementation/world.dart b/sdk/lib/_internal/compiler/implementation/world.dart
index 271629bf64132666df45a3b3aba08074886ca86e..f3142f6f94060c9a4e2e49995782b59b13a89cbd 100644
--- a/sdk/lib/_internal/compiler/implementation/world.dart
+++ b/sdk/lib/_internal/compiler/implementation/world.dart
@@ -130,6 +130,14 @@ class World {
return subclasses.contains(type.element);
}
+ // Returns whether a subclass of [superclass] mixes in [other].
+ bool hasAnySubclassThatMixes(ClassElement superclass, ClassElement other) {
+ Set<MixinApplicationElement> uses = mixinUses[other];
+ return (uses != null)
Lasse Reichstein Nielsen 2013/02/21 09:32:05 x ? y : false => x && y
+ ? uses.any((each) => each.isSubclassOf(superclass))
+ : false;
+ }
+
void registerUsedElement(Element element) {
if (element.isInstanceMember() && !element.isAbstract(compiler)) {
allFunctions.add(element);
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/universe/universe.dart ('k') | tests/language/mixin_override_regression_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698