Index: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart |
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart |
index ecdbccb2c6ff886921d45bbef35aea7f4b59ab60..63d5f86ad2f1e3ab65decdc65f359bf6a657aff9 100644 |
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart |
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart |
@@ -1185,6 +1185,23 @@ class StatementRewriter extends Transformer implements Pass { |
node.next = visitStatement(node.next); |
return node; |
} |
+ |
+ @override |
+ Statement visitNullCheck(NullCheck node) { |
+ inEmptyEnvironment(() { |
+ node.next = visitStatement(node.next); |
+ }); |
+ if (node.condition != null) { |
+ inEmptyEnvironment(() { |
+ // Value occurs in conditional context. |
+ node.value = visitExpression(node.value); |
+ }); |
+ node.condition = visitExpression(node.condition); |
+ } else { |
+ node.value = visitExpression(node.value); |
+ } |
+ return node; |
+ } |
} |
/// Result of combining two expressions, with the potential for reverting the |