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

Unified Diff: pkg/compiler/lib/src/common_elements.dart

Issue 2934783002: Handle named mixin application in emitter (Closed)
Patch Set: Fixes Created 3 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
Index: pkg/compiler/lib/src/common_elements.dart
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index 4404b74645f2ea4cc826ce75fdd9cb346dbf6116..760f5d16c2dc7a90abdfcf26d468bf97fe1a9512 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -1254,9 +1254,29 @@ abstract class ElementEnvironment {
/// Returns `true` if [cls] is generic.
bool isGenericClass(ClassEntity cls);
+ /// Returns `true` if [cls] is a mixin application (named or unnamed).
+ bool isMixinApplication(ClassEntity cls);
+
/// Returns `true` if [cls] is an unnamed mixin application.
bool isUnnamedMixinApplication(ClassEntity cls);
+ /// Returns the 'effective' mixin class if [cls] is a mixin application, and
+ /// `null` otherwise.
+ ///
+ /// The 'effective' mixin class is the class from which members are mixed in.
+ /// Normally this is the mixin class itself, but not if the mixin class itself
+ /// is a mixin application.
+ ///
+ /// Consider this hierarchy:
+ ///
+ /// class A {}
+ /// class B = Object with A {}
+ /// class C = Object with B {}
+ ///
+ /// The mixin classes of `B` and `C` are `A` and `B`, respectively, but the
+ /// _effective_ mixin class of both is `A`.
+ ClassEntity getEffectiveMixinClass(ClassEntity cls);
+
/// The upper bound on the [typeVariable]. If not explicitly declared, this is
/// `Object`.
DartType getTypeVariableBound(TypeVariableEntity typeVariable);

Powered by Google App Engine
This is Rietveld 408576698