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

Unified Diff: pkg/compiler/lib/src/elements/types.dart

Issue 2850143002: Reuse RuntimeTypesNeedBuilderImpl and _RuntimeTypesNeed for kernel based elements (Closed)
Patch Set: Fix comment Created 3 years, 8 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/elements/types.dart
diff --git a/pkg/compiler/lib/src/elements/types.dart b/pkg/compiler/lib/src/elements/types.dart
index 6e84728e19da76f8102ac9f05b0203ba390667b4..4ddcef3227b853d01ed5b7a3318201b42f491327 100644
--- a/pkg/compiler/lib/src/elements/types.dart
+++ b/pkg/compiler/lib/src/elements/types.dart
@@ -736,4 +736,14 @@ abstract class DartTypes {
/// Returns `true` if [t] might be a subtype of [s] for some values of
/// type variables in [s] and [t].
bool isPotentialSubtype(DartType t, DartType s);
+
+ /// Returns [type] as an instance of [cls] or `null` if [type] is not a
+ /// subtype of [cls].
+ ///
+ /// For instance `asInstanceOf(List<String>, Iterable) = Iterable<String>`.
+ InterfaceType asInstanceOf(InterfaceType type, ClassEntity cls);
+
+ /// Returns the supertype of [cls], i.e. the type in the `extends` clause of
+ /// [cls].
+ InterfaceType getSupertype(ClassEntity cls);
}

Powered by Google App Engine
This is Rietveld 408576698