Index: runtime/vm/ast_transformer.cc |
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc |
index fa1028d7e629ad3567833bcb143ac3ff29359ff5..af1331c59d3a5299ddc9fbb6779d5b4d1dae300a 100644 |
--- a/runtime/vm/ast_transformer.cc |
+++ b/runtime/vm/ast_transformer.cc |
@@ -119,7 +119,14 @@ void AwaitTransformer::VisitLiteralNode(LiteralNode* node) { |
void AwaitTransformer::VisitTypeNode(TypeNode* node) { |
- result_ = new (Z) TypeNode(node->token_pos(), node->type()); |
+ if (node->is_deferred_reference()) { |
+ // Deferred references must use a temporary even after loading |
+ // happened, so that the number of await temps is the same as |
+ // before the loading. |
+ result_ = MakeName(node); |
+ } else { |
+ result_ = node; |
+ } |
} |