Index: lib/compiler/implementation/ssa/builder.dart |
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart |
index 0f48c2db6630722f804d14577f59830eeb5c0b69..a5fa2748ead965e77e6fff7984dac9cf7bb5f6e4 100644 |
--- a/lib/compiler/implementation/ssa/builder.dart |
+++ b/lib/compiler/implementation/ssa/builder.dart |
@@ -1704,15 +1704,16 @@ class SsaBuilder implements Visitor { |
visit(node.receiver); |
HInstruction expression = pop(); |
Node argument = node.arguments.head; |
- TypeAnnotation type = argument.asTypeAnnotation(); |
+ TypeAnnotation typeAnnotation = argument.asTypeAnnotation(); |
bool isNot = false; |
// TODO(ngeoffray): Duplicating pattern in resolver. We should |
// add a new kind of node. |
- if (type == null) { |
- type = argument.asSend().receiver; |
+ if (typeAnnotation == null) { |
+ typeAnnotation = argument.asSend().receiver; |
isNot = true; |
} |
- HInstruction instruction = new HIs(elements[type], expression); |
+ Type type = elements.getType(typeAnnotation); |
+ HInstruction instruction = new HIs(type, expression); |
if (isNot) { |
add(instruction); |
instruction = new HNot(instruction); |
@@ -2742,11 +2743,11 @@ class SsaBuilder implements Visitor { |
condition = graph.addConstantBool(true); |
stack.add(condition); |
} else { |
- Element typeElement = elements[declaration.type]; |
- if (typeElement == null) { |
+ Type type = elements.getType(declaration.type); |
+ if (type == null) { |
compiler.cancel('Catch with unresolved type', node: catchBlock); |
} |
- condition = new HIs(typeElement, unwrappedException, nullOk: true); |
+ condition = new HIs(type, unwrappedException, nullOk: true); |
push(condition); |
} |
} |