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 d2a03884a251bc0d09d1aeed5a8646b62c70a063..f3ce0a1f2c520f5cdf5e000260d16404e0978e7b 100644 |
--- a/sdk/lib/_internal/compiler/implementation/world.dart |
+++ b/sdk/lib/_internal/compiler/implementation/world.dart |
@@ -13,6 +13,7 @@ class World { |
final Map<ClassElement, Set<ClassElement>> rtiDependencies; |
final FunctionSet userDefinedGetters; |
final FunctionSet userDefinedSetters; |
+ Link<ClassElement> classesUsingTypeVariableTests; |
World(Compiler compiler) |
: subtypes = new Map<ClassElement, Set<ClassElement>>(), |
@@ -23,6 +24,7 @@ class World { |
userDefinedSetters = new FunctionSet(compiler), |
classesNeedingRti = new Set<ClassElement>(), |
rtiDependencies = new Map<ClassElement, Set<ClassElement>>(), |
+ classesUsingTypeVariableTests = const Link<ClassElement>(), |
this.compiler = compiler; |
void populate() { |
@@ -219,6 +221,16 @@ class World { |
} |
return result; |
} |
+ |
+ /** |
+ * Register a class that contains an is-test against one of it type variables. |
+ * The class and all its subtypes need runtime type information and we need to |
+ * register the type arguments of their instantiations. |
+ */ |
+ registerTypeVariableCheck(ClassElement cls) { |
+ classesUsingTypeVariableTests = classesUsingTypeVariableTests.prepend(cls); |
+ classesNeedingRti.add(cls); |
+ } |
} |
/** |