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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart

Issue 17583007: Fix issue 11398 by making sure we look at mixin applications (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | tests/language/mixin_regress_11398_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart b/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
index 33cd88a2b64270805ed1c9a0a5ae3a6943f71ee2..3013586d3fce2c4586e5b05e341aa673fbf705c3 100644
--- a/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
@@ -429,11 +429,18 @@ class FlatTypeMask implements TypeMask {
|| compiler.world.hasAnySubclassThatMixes(self, other);
} else {
assert(isSubtype);
- return hasElementIn(self, selector, element, compiler)
+ bool result = hasElementIn(self, selector, element, compiler)
|| other.implementsInterface(self)
- || other.isSubclassOf(self)
- || compiler.world.hasAnySubclassThatMixes(self, other)
|| compiler.world.hasAnySubclassThatImplements(other, base);
+ if (result) return true;
+ // If the class is used as a mixin, we have to check if the element
+ // can be hit from any of the mixin applications.
+ Iterable<ClassElement> mixinUses = compiler.world.mixinUses[self];
+ if (mixinUses == null) return false;
+ return mixinUses.any((mixinApplication) =>
+ hasElementIn(mixinApplication, selector, element, compiler)
+ || other.isSubclassOf(mixinApplication)
ngeoffray 2013/06/24 08:59:06 indent one more?
+ || compiler.world.hasAnySubclassThatMixes(mixinApplication, other));
ngeoffray 2013/06/24 08:59:06 ditto
}
}
« no previous file with comments | « no previous file | tests/language/mixin_regress_11398_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698