Index: pkg/compiler/lib/src/js_backend/backend.dart |
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
index 2bd492d656ede023310ad8c0eaf8463963d25dcb..e813fe938a9f6e0dee1eefc47ca68fd2d6172d24 100644 |
--- a/pkg/compiler/lib/src/js_backend/backend.dart |
+++ b/pkg/compiler/lib/src/js_backend/backend.dart |
@@ -1106,7 +1106,7 @@ class JavaScriptBackend extends Backend { |
type.isFunctionType ? coreTypes.functionType : type; |
if (type is InterfaceType) { |
registry.registerInstantiation(instantiatedType); |
- if (!type.treatAsRaw && classNeedsRti(type.element)) { |
+ if (classNeedsRtiField(type.element)) { |
registry.registerStaticUse(new StaticUse.staticInvoke( |
// TODO(johnniwinther): Find the right [CallStructure]. |
helpers.setRuntimeTypeInfo, |
@@ -1475,8 +1475,14 @@ class JavaScriptBackend extends Backend { |
} |
bool classNeedsRti(ClassElement cls) { |
- return rti.classesNeedingRti.contains(cls.declaration) || |
- compiler.enabledRuntimeType; |
+ if (compiler.enabledRuntimeType) return true; |
+ return rti.classesNeedingRti.contains(cls.declaration); |
+ } |
+ |
+ bool classNeedsRtiField(ClassElement cls) { |
+ if (cls.rawType.typeArguments.isEmpty) return false; |
+ if (compiler.enabledRuntimeType) return true; |
+ return rti.classesNeedingRti.contains(cls.declaration); |
} |
bool isComplexNoSuchMethod(FunctionElement element) => |