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 271629bf64132666df45a3b3aba08074886ca86e..0f94a5d6a03d8ff26b81d882a8fa00e09be514a0 100644 |
--- a/sdk/lib/_internal/compiler/implementation/world.dart |
+++ b/sdk/lib/_internal/compiler/implementation/world.dart |
@@ -60,7 +60,6 @@ class World { |
// (3) subclasses of (2) and (3). |
void potentiallyAddForRti(ClassElement cls) { |
- if (cls.typeVariables.isEmpty) return; |
if (classesNeedingRti.contains(cls)) return; |
classesNeedingRti.add(cls); |
@@ -85,6 +84,10 @@ class World { |
if (!itf.isRaw) { |
potentiallyAddForRti(itf.element); |
} |
+ } else if (type is TypeVariableType) { |
+ TypeVariableElement variable = type.element; |
+ ClassElement enclosing = variable.enclosingElement; |
ngeoffray
2013/02/22 11:04:30
Why this change?
|
+ potentiallyAddForRti(enclosing); |
} |
}); |
} |
@@ -112,7 +115,9 @@ class World { |
} |
bool needsRti(ClassElement cls) { |
- return classesNeedingRti.contains(cls) || compiler.enabledRuntimeType; |
+ return classesNeedingRti.contains(cls) || |
+ compiler.enabledRuntimeType || |
+ compiler.hasVariableTypecheck; |
ngeoffray
2013/02/22 11:04:30
So any class needs rti when the check is on? Shoul
|
} |
bool hasAnyUserDefinedGetter(Selector selector) { |