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

Unified Diff: pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.expect

Issue 2895063003: Flatten futures when inferring the type of an async function expression. (Closed)
Patch Set: Don't recurse on future-derived types Created 3 years, 7 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 | « pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.expect
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.expect b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.expect
new file mode 100644
index 0000000000000000000000000000000000000000..68d859c9fcc9003db69f25f0c6b192d919eea6ef
--- /dev/null
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.expect
@@ -0,0 +1,36 @@
+library test;
+import self as self;
+import "dart:async" as asy;
+import "dart:core" as core;
+
+static field asy::Future<core::int> futureInt = null;
+static field () → asy::Future<core::int> f = () → dynamic => self::futureInt;
+static field () → asy::Future<core::int> g = () → dynamic /* originally async */ {
+ final asy::Completer<asy::FutureOr<dynamic>> :completer = asy::Completer::sync<asy::FutureOr<dynamic>>();
+ asy::FutureOr<dynamic> :return_value;
+ dynamic :async_op_then;
+ dynamic :async_op_error;
+ dynamic :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
+ try {
+ #L1:
+ {
+ :return_value = self::futureInt;
+ break #L1;
+ }
+ :completer.complete(:return_value);
+ return;
+ }
+ on dynamic catch(dynamic :exception, dynamic :stack_trace) {
+ :completer.completeError(:exception, :stack_trace);
+ }
+ :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+ :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+ asy::Future::microtask<dynamic>(:async_op);
+ return :completer.future;
+};
+static method main() → dynamic {
+ self::f;
+ self::g;
+}
« no previous file with comments | « pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698