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

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

Issue 267153002: Support general handling of type variables by substituting types into the current context. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased + reinserted unalias Created 6 years, 7 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/ordered_typeset.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ordered_typeset.dart b/sdk/lib/_internal/compiler/implementation/ordered_typeset.dart
index 98cc60ac4e8c75f80cec7ba90bd2d8fc6fab749a..1ec9ff337306f58a08a0fb08e058388434cc4a12 100644
--- a/sdk/lib/_internal/compiler/implementation/ordered_typeset.dart
+++ b/sdk/lib/_internal/compiler/implementation/ordered_typeset.dart
@@ -87,6 +87,22 @@ class OrderedTypeSet {
}
}
+ InterfaceType asInstanceOf(ClassElement cls) {
+ int level = cls.hierarchyDepth;
+ if (level < levels) {
+ Link<DartType> pointer = _levels[level];
+ Link<DartType> end =
+ level > 0 ? _levels[level - 1] : const Link<DartType>();
+ while (!identical(pointer, end)) {
+ if (cls == pointer.head.element) {
+ return pointer.head;
+ }
+ pointer = pointer.tail;
+ }
+ }
+ return null;
+ }
+
String toString() => types.toString();
}

Powered by Google App Engine
This is Rietveld 408576698