Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: runtime/vm/ast_transformer.cc

Issue 2683973002: Handle type literals correctly with deferred loading and await. (Closed)
Patch Set: add comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ }
}
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698