Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
index 66f93b0041e8fc959516172aeb503ff5eec2f4b4..e74a102396fdbb7eb435c18a1586799eee93d41e 100644 |
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
@@ -2841,7 +2841,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor { |
return new HIs(type, <HInstruction>[expression, call], |
HIs.VARIABLE_CHECK); |
} else if (RuntimeTypes.hasTypeArguments(type)) { |
- Element element = type.element; |
+ ClassElement element = type.element; |
Element helper = backend.getCheckSubtype(); |
HInstruction representations = |
buildTypeArgumentRepresentations(type); |
@@ -2849,10 +2849,9 @@ class SsaBuilder extends ResolvedVisitor implements Visitor { |
String operator = |
backend.namer.operatorIs(backend.getImplementationClass(element)); |
HInstruction isFieldName = addConstantString(node, operator); |
- // TODO(karlklose): use [:null:] for [asField] if [element] does not |
- // have a subclass. |
- HInstruction asFieldName = |
- addConstantString(node, backend.namer.substitutionName(element)); |
+ HInstruction asFieldName = compiler.world.hasAnySubtype(element) |
+ ? addConstantString(node, backend.namer.substitutionName(element)) |
+ : graph.addConstantNull(constantSystem); |
List<HInstruction> inputs = <HInstruction>[expression, |
isFieldName, |
representations, |