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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart

Issue 1013803006: Abort tracing in type inference in the presence of await. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: added test Created 5 years, 9 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
Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index f5460e37ba203c3f48a01a3e9f257f4c336459a1..d740569c0a627a7605798dad2a13243c4e753dab 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -281,6 +281,12 @@ abstract class InferrerEngine<T, V extends TypeSystem>
bool inLoop);
/**
+ * Registers a call to await with an expression of type [argumentType] as
+ * argument.
+ */
+ T registerAwait(ast.Node node, T argumentType);
+
+ /**
* Notifies to the inferrer that [analyzedElement] can have return
* type [newType]. [currentType] is the type the [InferrerVisitor]
* currently found.
@@ -1011,8 +1017,7 @@ class SimpleTypeInferrerVisitor<T>
T visitAwait(ast.Await node) {
T futureType = node.expression.accept(this);
- // TODO(herhut): Return a better type here if possible.
- return types.dynamicType;
+ return inferrer.registerAwait(node, futureType);
}
T visitStaticSend(ast.Send node) {
« no previous file with comments | « pkg/compiler/lib/src/inferrer/node_tracer.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698