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

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

Issue 2899073004: Use declared return type for inference of return and yield statements. (Closed)
Patch Set: Simpler implementation 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/top_level_return_and_yield.dart.outline.expect ('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/top_level_return_and_yield.dart.strong.expect
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
new file mode 100644
index 0000000000000000000000000000000000000000..51b8de5293e0f6a5b5c9e202afbbe1c5754cb999
--- /dev/null
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
@@ -0,0 +1,126 @@
+library test;
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+typedef IntToInt = (core::int) → core::int;
+static method a() → (core::int) → core::int {
+ return (core::int x) → core::int => x;
+}
+static method b() → asy::Future<(core::int) → core::int> /* originally async */ {
+ final asy::Completer<asy::FutureOr<(core::int) → core::int>> :completer = asy::Completer::sync<asy::FutureOr<(core::int) → core::int>>();
+ asy::FutureOr<(core::int) → core::int> :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 = (dynamic x) → dynamic => x;
+ 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 c() → core::Iterable<(core::int) → core::int> /* originally sync* */ {
+ dynamic :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ function :sync_op(core::Iterator<dynamic> :iterator) → core::bool yielding {
+ {
+ {
+ :iterator._current = (core::int x) → core::int => x;
+ [yield] true;
+ }
+ }
+ return false;
+ }
+ return new core::_SyncIterable::•(:sync_op);
+}
+static method d() → core::Iterable<(core::int) → core::int> /* originally sync* */ {
+ dynamic :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ function :sync_op(core::Iterator<dynamic> :iterator) → core::bool yielding {
+ {
+ {
+ :iterator.isYieldEach = true;
+ :iterator._current = <(core::int) → core::int>[(core::int x) → core::int => x];
+ [yield] true;
+ }
+ }
+ return false;
+ }
+ return new core::_SyncIterable::•(:sync_op);
+}
+static method e() → asy::Stream<(core::int) → core::int> /* originally async* */ {
+ dynamic :controller;
+ dynamic :async_op_then;
+ dynamic :async_op_error;
+ dynamic :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ dynamic :saved_try_context_var0;
+ dynamic :saved_try_context_var1;
+ function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
+ try
+ try {
+ #L2:
+ {
+ if(:controller.add((core::int x) → core::int => x))
+ return null;
+ else
+ [yield] null;
+ }
+ return;
+ }
+ on dynamic catch(dynamic :exception, dynamic :stack_trace) {
+ :controller.addError(:exception, :stack_trace);
+ }
+ finally {
+ :controller.close();
+ }
+ :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+ :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+ :controller = new asy::_AsyncStarStreamController::•(:async_op);
+ return :controller.stream;
+}
+static method f() → asy::Stream<(core::int) → core::int> /* originally async* */ {
+ dynamic :controller;
+ dynamic :async_op_then;
+ dynamic :async_op_error;
+ dynamic :await_jump_var = 0;
+ dynamic :await_ctx_var;
+ dynamic :saved_try_context_var0;
+ dynamic :saved_try_context_var1;
+ function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
+ try
+ try {
+ #L3:
+ {
+ if(:controller.addStream(asy::Stream::fromIterable<(core::int) → core::int>(<(core::int) → core::int>[(core::int x) → core::int => x])))
+ return null;
+ else
+ [yield] null;
+ }
+ return;
+ }
+ on dynamic catch(dynamic :exception, dynamic :stack_trace) {
+ :controller.addError(:exception, :stack_trace);
+ }
+ finally {
+ :controller.close();
+ }
+ :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+ :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+ :controller = new asy::_AsyncStarStreamController::•(:async_op);
+ return :controller.stream;
+}
+static method main() → dynamic {}
« no previous file with comments | « pkg/front_end/testcases/inference/top_level_return_and_yield.dart.outline.expect ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698