diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart index b77b5c9684f..cd4c3268cf4 100644 --- a/pkg/front_end/lib/src/fasta/source/source_loader.dart +++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart @@ -2588,7 +2588,7 @@ void _asyncStarMoveNextHelper(var stream) {} _asyncThenWrapperHelper(continuation) {} -_awaitHelper(object, thenCallback, errorCallback, awaiter) {} +_awaitHelper(object, thenCallback, errorCallback) {} _completeOnAsyncReturn(_future, value, async_jump_var) {} diff --git a/pkg/front_end/testcases/extensions/async_extensions.dart.weak.transformed.expect b/pkg/front_end/testcases/extensions/async_extensions.dart.weak.transformed.expect index aaa00172e9f..739da7f0d16 100644 --- a/pkg/front_end/testcases/extensions/async_extensions.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/extensions/async_extensions.dart.weak.transformed.expect @@ -33,7 +33,7 @@ static method Extension|asyncMethod(lowered final core::int* #this) → dynamic (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -45,7 +45,7 @@ static method Extension|asyncMethod(lowered final core::int* #this) → dynamic } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -58,7 +58,7 @@ static method Extension|asyncStarMethod(lowered final core::int* #this) → dyna (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L2: diff --git a/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.weak.transformed.expect b/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.weak.transformed.expect index cda03ddbb39..2aa57c8b355 100644 --- a/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.weak.transformed.expect @@ -23,12 +23,12 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(LoadLibrary(prefix), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t1 = asy::_awaitHelper(LoadLibrary(prefix), :async_op_then, :async_op_error) in null; + :result_or_exception; self::expect(0, let final core::Object* #t2 = CheckLibraryIsLoaded(prefix) in def::Extension|staticField); self::expect(0, let final core::Object* #t3 = CheckLibraryIsLoaded(prefix) in def::Extension|get#property(0)); self::expect(42, let final core::Object* #t4 = CheckLibraryIsLoaded(prefix) in let final core::int* #t5 = 0 in let final core::int* #t6 = 42 in let final void #t7 = def::Extension|set#property(#t5, #t6) in #t6); @@ -46,7 +46,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -100,4 +100,4 @@ Extra constant evaluation status: Evaluated: VariableGet @ org-dartlang-testcase:///deferred_explicit_access.dart:12:31 -> IntConstant(0) Evaluated: VariableGet @ org-dartlang-testcase:///deferred_explicit_access.dart:12:45 -> IntConstant(42) Evaluated: VariableGet @ org-dartlang-testcase:///deferred_explicit_access.dart:12:45 -> IntConstant(42) -Extra constant evaluation: evaluated: 92, effectively constant: 3 +Extra constant evaluation: evaluated: 91, effectively constant: 3 diff --git a/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.weak.transformed.expect b/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.weak.transformed.expect index 52535cdb677..f4d6fd73bba 100644 --- a/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.weak.transformed.expect @@ -15,12 +15,12 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(LoadLibrary(prefix), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t1 = asy::_awaitHelper(LoadLibrary(prefix), :async_op_then, :async_op_error) in null; + :result_or_exception; self::expect(0, let final core::Object* #t2 = CheckLibraryIsLoaded(prefix) in def::topLevelField); self::expect(42, let final core::Object* #t3 = CheckLibraryIsLoaded(prefix) in def::topLevelField = 42); self::expect(42, let final core::Object* #t4 = CheckLibraryIsLoaded(prefix) in def::topLevelField); @@ -37,7 +37,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/async_function.dart.weak.transformed.expect b/pkg/front_end/testcases/general/async_function.dart.weak.transformed.expect index 4b96489c805..bba287bdea4 100644 --- a/pkg/front_end/testcases/general/async_function.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/async_function.dart.weak.transformed.expect @@ -15,7 +15,7 @@ static method asyncString() → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -30,7 +30,7 @@ static method asyncString() → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -42,7 +42,7 @@ static method asyncString2() → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -57,7 +57,7 @@ static method asyncString2() → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -112,7 +112,7 @@ static method asyncStarString() → asy::Stream* /* originally as 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: @@ -125,8 +125,8 @@ static method asyncStarString() → asy::Stream* /* originally as return null; else [yield] null; - [yield] let dynamic #t1 = asy::_awaitHelper(self::asyncString(), :async_op_then, :async_op_error, :async_op) in null; - if(:controller.{asy::_AsyncStarStreamController::add}(_in::unsafeCast(:result)){(core::String*) → core::bool}) + [yield] let dynamic #t1 = asy::_awaitHelper(self::asyncString(), :async_op_then, :async_op_error) in null; + if(:controller.{asy::_AsyncStarStreamController::add}(_in::unsafeCast(:result_or_exception)){(core::String*) → core::bool}) return null; else [yield] null; @@ -154,7 +154,7 @@ static method asyncStarString2() → asy::Stream* /* originally a 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L4: @@ -187,12 +187,12 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { - [yield] let dynamic #t2 = asy::_awaitHelper(self::asyncString(), :async_op_then, :async_op_error, :async_op) in null; - core::String* str = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(self::asyncString(), :async_op_then, :async_op_error) in null; + core::String* str = _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -202,7 +202,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/async_function_returns_future_or.dart.weak.transformed.expect b/pkg/front_end/testcases/general/async_function_returns_future_or.dart.weak.transformed.expect index 3100e065611..2ccc693a861 100644 --- a/pkg/front_end/testcases/general/async_function_returns_future_or.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/async_function_returns_future_or.dart.weak.transformed.expect @@ -15,30 +15,30 @@ static method main() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::returnsString(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::returnsFutureOrString(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t3 = asy::_awaitHelper(self::returnsAwaitFutureOrString(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t4 = asy::_awaitHelper(self::returnsFutureString(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t5 = asy::_awaitHelper(self::returnsAwaitFutureString(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t6 = asy::_awaitHelper(self::returnsObject(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t7 = asy::_awaitHelper(self::returnsFutureOrObject(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t8 = asy::_awaitHelper(self::returnsAwaitFutureOrObject(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t9 = asy::_awaitHelper(self::returnsFutureObject(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t10 = asy::_awaitHelper(self::returnsAwaitFutureObject(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(self::returnsString(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::returnsFutureOrString(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t3 = asy::_awaitHelper(self::returnsAwaitFutureOrString(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t4 = asy::_awaitHelper(self::returnsFutureString(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t5 = asy::_awaitHelper(self::returnsAwaitFutureString(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t6 = asy::_awaitHelper(self::returnsObject(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t7 = asy::_awaitHelper(self::returnsFutureOrObject(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t8 = asy::_awaitHelper(self::returnsAwaitFutureOrObject(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t9 = asy::_awaitHelper(self::returnsFutureObject(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t10 = asy::_awaitHelper(self::returnsAwaitFutureObject(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -48,7 +48,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -60,7 +60,7 @@ static method returnsString() → asy::Future /* originally async (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -75,7 +75,7 @@ static method returnsString() → asy::Future /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -87,7 +87,7 @@ static method returnsFutureOrString() → asy::Future /* originall (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -102,7 +102,7 @@ static method returnsFutureOrString() → asy::Future /* originall } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -115,12 +115,12 @@ static method returnsAwaitFutureOrString() → asy::Future /* orig core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t11 = asy::_awaitHelper(self::getFutureOr("a"), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t11 = asy::_awaitHelper(self::getFutureOr("a"), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L4; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -131,7 +131,7 @@ static method returnsAwaitFutureOrString() → asy::Future /* orig } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -143,7 +143,7 @@ static method returnsFutureString() → asy::Future /* originally (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -158,7 +158,7 @@ static method returnsFutureString() → asy::Future /* originally } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -171,12 +171,12 @@ static method returnsAwaitFutureString() → FutureOr /* originall core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { - [yield] let dynamic #t12 = asy::_awaitHelper(self::getFuture("a"), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t12 = asy::_awaitHelper(self::getFuture("a"), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L6; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -187,7 +187,7 @@ static method returnsAwaitFutureString() → FutureOr /* originall } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -199,7 +199,7 @@ static method returnsObject() → asy::Future /* originally async (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { @@ -214,7 +214,7 @@ static method returnsObject() → asy::Future /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -226,7 +226,7 @@ static method returnsFutureOrObject() → asy::Future /* originall (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { @@ -241,7 +241,7 @@ static method returnsFutureOrObject() → asy::Future /* originall } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -254,12 +254,12 @@ static method returnsAwaitFutureOrObject() → asy::Future /* orig core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { - [yield] let dynamic #t13 = asy::_awaitHelper(self::getFutureOr(new core::Object::•()), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t13 = asy::_awaitHelper(self::getFutureOr(new core::Object::•()), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L9; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -270,7 +270,7 @@ static method returnsAwaitFutureOrObject() → asy::Future /* orig } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -282,7 +282,7 @@ static method returnsFutureObject() → asy::Future /* originally (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { @@ -297,7 +297,7 @@ static method returnsFutureObject() → asy::Future /* originally } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -310,12 +310,12 @@ static method returnsAwaitFutureObject() → FutureOr /* originall core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { - [yield] let dynamic #t14 = asy::_awaitHelper(self::getFuture(new core::Object::•()), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t14 = asy::_awaitHelper(self::getFuture(new core::Object::•()), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L11; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -326,7 +326,7 @@ static method returnsAwaitFutureObject() → FutureOr /* originall } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -338,7 +338,7 @@ static method getFutureOr(self::getFutureOr:: (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L12: { @@ -353,7 +353,7 @@ static method getFutureOr(self::getFutureOr:: } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -365,7 +365,7 @@ static method getFuture(self::getFuture::T% v (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L13: { @@ -380,7 +380,7 @@ static method getFuture(self::getFuture::T% v } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/async_method_with_invalid_type.dart.weak.transformed.expect b/pkg/front_end/testcases/general/async_method_with_invalid_type.dart.weak.transformed.expect index 7e775505d94..ae5f661aa0f 100644 --- a/pkg/front_end/testcases/general/async_method_with_invalid_type.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/async_method_with_invalid_type.dart.weak.transformed.expect @@ -18,7 +18,7 @@ static method foo() → dynamic /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -32,7 +32,7 @@ static method foo() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/async_nested.dart.weak.transformed.expect b/pkg/front_end/testcases/general/async_nested.dart.weak.transformed.expect index ef502e20e46..3a4b166b201 100644 --- a/pkg/front_end/testcases/general/async_nested.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/async_nested.dart.weak.transformed.expect @@ -39,23 +39,23 @@ static method main() → void /* originally async */ { self::Node* :async_temporary_0; self::Node* :async_temporary_1; self::Node* :async_temporary_2; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { core::String* expected = "1 2 3 4 5 6 7 8 9 10"; :async_temporary_2 = new self::Node::•("2", core::_GrowableList::•(0)); - [yield] let dynamic #t4 = asy::_awaitHelper(asy::Future::value(new self::Node::•("7", core::_GrowableList::•(0))), :async_op_then, :async_op_error, :async_op) in null; - [yield] let dynamic #t5 = asy::_awaitHelper(asy::Future::value(new self::Node::•("6", core::_GrowableList::_literal1(_in::unsafeCast(:result)))), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_1 = _in::unsafeCast(:result); - [yield] let dynamic #t6 = asy::_awaitHelper(asy::Future::value(new self::Node::•("8", core::_GrowableList::•(0))), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); - [yield] let dynamic #t7 = asy::_awaitHelper(asy::Future::value(new self::Node::•("9", core::_GrowableList::•(0))), :async_op_then, :async_op_error, :async_op) in null; - [yield] let dynamic #t8 = asy::_awaitHelper(asy::Future::value(new self::Node::•("4", core::_GrowableList::_literal1(new self::Node::•("5", core::_GrowableList::_literal3(_in::unsafeCast(:async_temporary_1), _in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result)))))), :async_op_then, :async_op_error, :async_op) in null; - [yield] let dynamic #t9 = asy::_awaitHelper(asy::Future::value(new self::Node::•("3", core::_GrowableList::_literal1(_in::unsafeCast(:result)))), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); - [yield] let dynamic #t10 = asy::_awaitHelper(asy::Future::value(new self::Node::•("10", core::_GrowableList::•(0))), :async_op_then, :async_op_error, :async_op) in null; - self::Node* node = new self::Node::•("1", core::_GrowableList::_literal3(_in::unsafeCast(:async_temporary_2), _in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result))); + [yield] let dynamic #t4 = asy::_awaitHelper(asy::Future::value(new self::Node::•("7", core::_GrowableList::•(0))), :async_op_then, :async_op_error) in null; + [yield] let dynamic #t5 = asy::_awaitHelper(asy::Future::value(new self::Node::•("6", core::_GrowableList::_literal1(_in::unsafeCast(:result_or_exception)))), :async_op_then, :async_op_error) in null; + :async_temporary_1 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t6 = asy::_awaitHelper(asy::Future::value(new self::Node::•("8", core::_GrowableList::•(0))), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t7 = asy::_awaitHelper(asy::Future::value(new self::Node::•("9", core::_GrowableList::•(0))), :async_op_then, :async_op_error) in null; + [yield] let dynamic #t8 = asy::_awaitHelper(asy::Future::value(new self::Node::•("4", core::_GrowableList::_literal1(new self::Node::•("5", core::_GrowableList::_literal3(_in::unsafeCast(:async_temporary_1), _in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result_or_exception)))))), :async_op_then, :async_op_error) in null; + [yield] let dynamic #t9 = asy::_awaitHelper(asy::Future::value(new self::Node::•("3", core::_GrowableList::_literal1(_in::unsafeCast(:result_or_exception)))), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t10 = asy::_awaitHelper(asy::Future::value(new self::Node::•("10", core::_GrowableList::•(0))), :async_op_then, :async_op_error) in null; + self::Node* node = new self::Node::•("1", core::_GrowableList::_literal3(_in::unsafeCast(:async_temporary_2), _in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result_or_exception))); core::String* actual = node.{self::Node::toSimpleString}(){() →* dynamic} as{TypeError,ForDynamic} core::String*; core::print(actual); if(!(actual =={core::String::==}{(core::Object*) →* core::bool*} expected)) { @@ -70,7 +70,7 @@ static method main() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/await.dart.weak.transformed.expect b/pkg/front_end/testcases/general/await.dart.weak.transformed.expect index 7fd936bab98..e7bee2fb882 100644 --- a/pkg/front_end/testcases/general/await.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/await.dart.weak.transformed.expect @@ -13,12 +13,12 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper("Hello, World!", :async_op_then, :async_op_error, :async_op) in null; - core::print(_in::unsafeCast(:result)); + [yield] let dynamic #t1 = asy::_awaitHelper("Hello, World!", :async_op_then, :async_op_error) in null; + core::print(_in::unsafeCast(:result_or_exception)); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -28,7 +28,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/await_complex.dart.weak.transformed.expect b/pkg/front_end/testcases/general/await_complex.dart.weak.transformed.expect index 22900f08b07..a29ca5f61a8 100644 --- a/pkg/front_end/testcases/general/await_complex.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/await_complex.dart.weak.transformed.expect @@ -71,33 +71,33 @@ static method staticMembers() → dynamic /* originally async */ { core::int* :async_temporary_3; core::int* :async_temporary_4; core::int* :async_temporary_5; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { :async_temporary_0 = self::C::staticField; - [yield] let dynamic #t1 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* a = _in::unsafeCast(:async_temporary_0).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t1 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* a = _in::unsafeCast(:async_temporary_0).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, a); :async_temporary_1 = self::C::staticField = 1; - [yield] let dynamic #t2 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* f = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t2 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* f = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, f); :async_temporary_2 = self::C::staticGetter; - [yield] let dynamic #t3 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* b = _in::unsafeCast(:async_temporary_2).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t3 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* b = _in::unsafeCast(:async_temporary_2).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, b); :async_temporary_3 = self::C::staticSetter = 1; - [yield] let dynamic #t4 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* c = _in::unsafeCast(:async_temporary_3).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t4 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* c = _in::unsafeCast(:async_temporary_3).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, c); :async_temporary_4 = self::C::staticFoo(2); - [yield] let dynamic #t5 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* d = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t5 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* d = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(3, d); :async_temporary_5 = self::C::staticField.{core::num::+}(self::C::staticGetter){(core::num*) →* core::int*}.{core::num::+}(self::C::staticSetter = 1){(core::num*) →* core::int*}.{core::num::+}(self::C::staticFoo(1)){(core::num*) →* core::int*}; - [yield] let dynamic #t6 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* e = _in::unsafeCast(:async_temporary_5).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t6 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* e = _in::unsafeCast(:async_temporary_5).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(5, e); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -108,7 +108,7 @@ static method staticMembers() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -126,29 +126,29 @@ static method topLevelMembers() → dynamic /* originally async */ { core::int* :async_temporary_2; core::int* :async_temporary_3; core::int* :async_temporary_4; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { :async_temporary_0 = self::globalVariable; - [yield] let dynamic #t7 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* a = _in::unsafeCast(:async_temporary_0).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t7 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* a = _in::unsafeCast(:async_temporary_0).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, a); :async_temporary_1 = self::topLevelGetter; - [yield] let dynamic #t8 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* b = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t8 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* b = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, b); :async_temporary_2 = self::topLevelSetter = 1; - [yield] let dynamic #t9 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* c = _in::unsafeCast(:async_temporary_2).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t9 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* c = _in::unsafeCast(:async_temporary_2).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, c); :async_temporary_3 = self::topLevelFoo(1); - [yield] let dynamic #t10 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* d = _in::unsafeCast(:async_temporary_3).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t10 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* d = _in::unsafeCast(:async_temporary_3).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, d); :async_temporary_4 = self::globalVariable.{core::num::+}(self::topLevelGetter){(core::num*) →* core::int*}.{core::num::+}(self::topLevelSetter = 1){(core::num*) →* core::int*}.{core::num::+}(self::topLevelFoo(1)){(core::num*) →* core::int*}; - [yield] let dynamic #t11 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* e = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t11 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* e = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(5, e); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -159,7 +159,7 @@ static method topLevelMembers() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -177,30 +177,30 @@ static method instanceMembers() → dynamic /* originally async */ { core::int* :async_temporary_2; core::int* :async_temporary_3; core::int* :async_temporary_4; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { self::C* inst = new self::C::•(); :async_temporary_0 = inst.{self::C::field}{core::int*}; - [yield] let dynamic #t12 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* a = _in::unsafeCast(:async_temporary_0).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t12 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* a = _in::unsafeCast(:async_temporary_0).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, a); :async_temporary_1 = inst.{self::C::getter}{core::int*}; - [yield] let dynamic #t13 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* b = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t13 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* b = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, b); :async_temporary_2 = inst.{self::C::setter} = 1; - [yield] let dynamic #t14 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* c = _in::unsafeCast(:async_temporary_2).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t14 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* c = _in::unsafeCast(:async_temporary_2).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, c); :async_temporary_3 = inst.{self::C::foo}(1){(core::int*) →* core::int*}; - [yield] let dynamic #t15 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* d = _in::unsafeCast(:async_temporary_3).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t15 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* d = _in::unsafeCast(:async_temporary_3).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, d); :async_temporary_4 = inst.{self::C::field}{core::int*}.{core::num::+}(inst.{self::C::getter}{core::int*}){(core::num*) →* core::int*}.{core::num::+}(inst.{self::C::setter} = 1){(core::num*) →* core::int*}.{core::num::+}(inst.{self::C::foo}(1){(core::int*) →* core::int*}){(core::num*) →* core::int*}; - [yield] let dynamic #t16 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* e = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t16 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* e = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(5, e); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -211,7 +211,7 @@ static method instanceMembers() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -229,30 +229,30 @@ static method others() → dynamic /* originally async */ { core::int* :async_temporary_2; core::List* :async_temporary_3; core::int* :async_temporary_4; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { :async_temporary_0 = self::globalVariable; - [yield] let dynamic #t17 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = "${_in::unsafeCast(:async_temporary_0)} ${:result} "; - [yield] let dynamic #t18 = asy::_awaitHelper("someString", :async_op_then, :async_op_error, :async_op) in null; - core::String* a = _in::unsafeCast(:async_temporary_0).{core::String::+}(_in::unsafeCast(:result)){(core::String*) →* core::String*}; + [yield] let dynamic #t17 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + :async_temporary_0 = "${_in::unsafeCast(:async_temporary_0)} ${:result_or_exception} "; + [yield] let dynamic #t18 = asy::_awaitHelper("someString", :async_op_then, :async_op_error) in null; + core::String* a = _in::unsafeCast(:async_temporary_0).{core::String::+}(_in::unsafeCast(:result_or_exception)){(core::String*) →* core::String*}; self::expect("1 1 someString", a); self::C* c = new self::C::•(); :async_temporary_1 = c.{self::C::field}{core::int*}; - [yield] let dynamic #t19 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* d = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t19 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* d = _in::unsafeCast(:async_temporary_1).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; core::int* cnt = 2; core::List* b = core::_GrowableList::_literal3(1, 2, 3); :async_temporary_3 = b; :async_temporary_2 = cnt; - [yield] let dynamic #t20 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast*>(:async_temporary_3).{core::List::[]=}(_in::unsafeCast(:async_temporary_2), :result as{TypeError,ForDynamic} core::int*){(core::int*, core::int*) →* void}; + [yield] let dynamic #t20 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + _in::unsafeCast*>(:async_temporary_3).{core::List::[]=}(_in::unsafeCast(:async_temporary_2), :result_or_exception as{TypeError,ForDynamic} core::int*){(core::int*, core::int*) →* void}; self::expect(1, b.{core::List::[]}(cnt){(core::int*) →* core::int*}); :async_temporary_4 = b.{core::List::[]}(0){(core::int*) →* core::int*}; - [yield] let dynamic #t21 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - core::num* e = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; + [yield] let dynamic #t21 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + core::num* e = _in::unsafeCast(:async_temporary_4).{core::num::+}(:result_or_exception as{TypeError,ForDynamic} core::num*){(core::num*) →* core::num*}; self::expect(2, e); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -263,7 +263,7 @@ static method others() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -281,7 +281,7 @@ static method conditionals() → dynamic /* originally async */ { dynamic :async_temporary_1; dynamic :async_temporary_2; dynamic :async_temporary_3; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -291,8 +291,8 @@ static method conditionals() → dynamic /* originally async */ { if(_in::unsafeCast(:async_temporary_0)) ; else { - [yield] let dynamic #t22 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = :result as{TypeError,ForDynamic} core::bool* =={core::Object::==}{(core::Object) → core::bool} true; + [yield] let dynamic #t22 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + :async_temporary_0 = :result_or_exception as{TypeError,ForDynamic} core::bool* =={core::Object::==}{(core::Object) → core::bool} true; } core::bool* c = _in::unsafeCast(:async_temporary_0); self::expect(true, c); @@ -300,14 +300,14 @@ static method conditionals() → dynamic /* originally async */ { :async_temporary_1 = a; } else { - [yield] let dynamic #t23 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_1 = :result; + [yield] let dynamic #t23 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + :async_temporary_1 = :result_or_exception; } dynamic d = :async_temporary_1; self::expect(false, d); if(a is core::int*) { - [yield] let dynamic #t24 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_2 = :result; + [yield] let dynamic #t24 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + :async_temporary_2 = :result_or_exception; } else { :async_temporary_2 = 2; @@ -316,8 +316,8 @@ static method conditionals() → dynamic /* originally async */ { self::expect(2, e); try { if(a is core::int*) { - [yield] let dynamic #t25 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_3 = :result; + [yield] let dynamic #t25 = asy::_awaitHelper(self::dummy(), :async_op_then, :async_op_error) in null; + :async_temporary_3 = :result_or_exception; } else { :async_temporary_3 = 2; @@ -335,7 +335,7 @@ static method conditionals() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -349,7 +349,7 @@ static method asserts() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -360,34 +360,34 @@ static method asserts() → dynamic /* originally async */ { { final (T*) →* FutureOr* func = #t26 as{TypeError} (T*) →* FutureOr*; assert { - [yield] let dynamic #t27 = asy::_awaitHelper(func(true){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - assert(_in::unsafeCast(:result)); + [yield] let dynamic #t27 = asy::_awaitHelper(func(true){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + assert(_in::unsafeCast(:result_or_exception)); } assert { if(self::id(true) as{TypeError} core::bool*) ; else { - [yield] let dynamic #t28 = asy::_awaitHelper(func("message"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - assert(false, _in::unsafeCast(:result)); + [yield] let dynamic #t28 = asy::_awaitHelper(func("message"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + assert(false, _in::unsafeCast(:result_or_exception)); } } assert { - [yield] let dynamic #t29 = asy::_awaitHelper(func(true){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) + [yield] let dynamic #t29 = asy::_awaitHelper(func(true){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) ; else { - [yield] let dynamic #t30 = asy::_awaitHelper(func("message"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - assert(false, _in::unsafeCast(:result)); + [yield] let dynamic #t30 = asy::_awaitHelper(func("message"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + assert(false, _in::unsafeCast(:result_or_exception)); } } try { assert { - [yield] let dynamic #t31 = asy::_awaitHelper(func(false){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) + [yield] let dynamic #t31 = asy::_awaitHelper(func(false){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) ; else { - [yield] let dynamic #t32 = asy::_awaitHelper(func("message"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - assert(false, _in::unsafeCast(:result)); + [yield] let dynamic #t32 = asy::_awaitHelper(func("message"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + assert(false, _in::unsafeCast(:result_or_exception)); } } if(self::assertStatementsEnabled) @@ -408,7 +408,7 @@ static method asserts() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -428,7 +428,7 @@ static method controlFlow() → dynamic /* originally async */ { dynamic :stack_trace0; core::List* :async_temporary_0; core::List* :async_temporary_1; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { @@ -447,16 +447,16 @@ static method controlFlow() → dynamic /* originally async */ { core::int* i; if(#t34) { #t34 = false; - [yield] let dynamic #t36 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - i = _in::unsafeCast(:result); + [yield] let dynamic #t36 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + i = _in::unsafeCast(:result_or_exception); } else { i = #t35; - [yield] let dynamic #t37 = asy::_awaitHelper(func(let final core::int* #t38 = i in let final core::int* #t39 = i = #t38.{core::num::+}(1){(core::num*) →* core::int*} in #t38){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t37 = asy::_awaitHelper(func(let final core::int* #t38 = i in let final core::int* #t39 = i = #t38.{core::num::+}(1){(core::num*) →* core::int*} in #t38){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } - [yield] let dynamic #t40 = asy::_awaitHelper(func(i.{core::num::<}(5){(core::num*) →* core::bool*}){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t40 = asy::_awaitHelper(func(i.{core::num::<}(5){(core::num*) →* core::bool*}){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { { c = c.{core::num::+}(1){(core::num*) →* core::int*}; } @@ -470,8 +470,8 @@ static method controlFlow() → dynamic /* originally async */ { c = 0; #L9: while (true) { - [yield] let dynamic #t41 = asy::_awaitHelper(func(c.{core::num::<}(5){(core::num*) →* core::bool*}){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) + [yield] let dynamic #t41 = asy::_awaitHelper(func(c.{core::num::<}(5){(core::num*) →* core::bool*}){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) c = c.{core::num::+}(1){(core::num*) →* core::int*}; else break #L9; @@ -480,26 +480,26 @@ static method controlFlow() → dynamic /* originally async */ { c = 0; do { c = c.{core::num::+}(1){(core::num*) →* core::int*}; - [yield] let dynamic #t42 = asy::_awaitHelper(func(c.{core::num::<}(5){(core::num*) →* core::bool*}){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; + [yield] let dynamic #t42 = asy::_awaitHelper(func(c.{core::num::<}(5){(core::num*) →* core::bool*}){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error) in null; } - while (_in::unsafeCast(:result)) + while (_in::unsafeCast(:result_or_exception)) self::expect(5, c); - [yield] let dynamic #t43 = asy::_awaitHelper(func(c =={core::num::==}{(core::Object*) →* core::bool*} 5){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t43 = asy::_awaitHelper(func(c =={core::num::==}{(core::Object*) →* core::bool*} 5){(core::bool*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { self::expect(5, c); } else { throw "unreachable"; } try { - [yield] let dynamic #t44 = asy::_awaitHelper(func("string"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - throw _in::unsafeCast(:result); + [yield] let dynamic #t44 = asy::_awaitHelper(func("string"){(core::String*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + throw _in::unsafeCast(:result_or_exception); } on core::String* catch(no-exception-var) { } try { - [yield] let dynamic #t45 = asy::_awaitHelper(throw "string", :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t45 = asy::_awaitHelper(throw "string", :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } on core::String* catch(no-exception-var) { } @@ -511,28 +511,28 @@ static method controlFlow() → dynamic /* originally async */ { } on dynamic catch(final dynamic e) { self::expect("string", e); - [yield] let dynamic #t46 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - self::expect(0, _in::unsafeCast(:result)); + [yield] let dynamic #t46 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + self::expect(0, _in::unsafeCast(:result_or_exception)); rethrow; } finally { - [yield] let dynamic #t47 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - self::expect(0, _in::unsafeCast(:result)); + [yield] let dynamic #t47 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + self::expect(0, _in::unsafeCast(:result_or_exception)); } } on dynamic catch(final dynamic e) { - [yield] let dynamic #t48 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - self::expect(0, _in::unsafeCast(:result)); + [yield] let dynamic #t48 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + self::expect(0, _in::unsafeCast(:result_or_exception)); self::expect("string", e); } finally { - [yield] let dynamic #t49 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - self::expect(0, _in::unsafeCast(:result)); + [yield] let dynamic #t49 = asy::_awaitHelper(func(0){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + self::expect(0, _in::unsafeCast(:result_or_exception)); } #L10: { - [yield] let dynamic #t50 = asy::_awaitHelper(func(2){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - switch(_in::unsafeCast(:result)) { + [yield] let dynamic #t50 = asy::_awaitHelper(func(2){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + switch(_in::unsafeCast(:result_or_exception)) { #L11: case #C3: { @@ -554,12 +554,12 @@ static method controlFlow() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L13: { - [yield] let dynamic #t52 = asy::_awaitHelper(func(42){(dynamic) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t52 = asy::_awaitHelper(func(42){(dynamic) →* FutureOr*}, :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L13; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -570,11 +570,11 @@ static method controlFlow() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; - })(){() →* asy::Future*}, :async_op_then, :async_op_error, :async_op) in null; - self::expect(42, :result); + })(){() →* asy::Future*}, :async_op_then, :async_op_error) in null; + self::expect(42, :result_or_exception); [yield] let dynamic #t53 = asy::_awaitHelper((() → asy::Future* /* originally async */ { final asy::_Future* :async_future = new asy::_Future::•(); core::bool* :is_sync = false; @@ -583,7 +583,7 @@ static method controlFlow() → dynamic /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L14: { @@ -598,11 +598,11 @@ static method controlFlow() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; - })(){() →* asy::Future*}, :async_op_then, :async_op_error, :async_op) in null; - self::expect(42, :result); + })(){() →* asy::Future*}, :async_op_then, :async_op_error) in null; + self::expect(42, :result_or_exception); function testStream1() → asy::Stream* /* originally async* */ { asy::_AsyncStarStreamController* :controller; dynamic :controller_stream; @@ -612,13 +612,13 @@ static method controlFlow() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L15: { - [yield] let dynamic #t54 = asy::_awaitHelper(func(42){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error, :async_op) in null; - if(:controller.{asy::_AsyncStarStreamController::add}(_in::unsafeCast(:result)){(core::int*) → core::bool}) + [yield] let dynamic #t54 = asy::_awaitHelper(func(42){(core::int*) →* FutureOr*}, :async_op_then, :async_op_error) in null; + if(:controller.{asy::_AsyncStarStreamController::add}(_in::unsafeCast(:result_or_exception)){(core::int*) → core::bool}) return null; else [yield] null; @@ -638,8 +638,8 @@ static method controlFlow() → dynamic /* originally async */ { return :controller_stream; } :async_temporary_0 = core::_GrowableList::_literal1(42); - [yield] let dynamic #t55 = asy::_awaitHelper(testStream1(){() →* asy::Stream*}.{asy::Stream::toList}(){() →* asy::Future*>*}, :async_op_then, :async_op_error, :async_op) in null; - self::expectList(_in::unsafeCast*>(:async_temporary_0), _in::unsafeCast*>(:result)); + [yield] let dynamic #t55 = asy::_awaitHelper(testStream1(){() →* asy::Stream*}.{asy::Stream::toList}(){() →* asy::Future*>*}, :async_op_then, :async_op_error) in null; + self::expectList(_in::unsafeCast*>(:async_temporary_0), _in::unsafeCast*>(:result_or_exception)); function testStream2() → asy::Stream* /* originally async* */ { asy::_AsyncStarStreamController* :controller; dynamic :controller_stream; @@ -649,13 +649,13 @@ static method controlFlow() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L16: { - [yield] let dynamic #t56 = asy::_awaitHelper(func*>(self::intStream()){(asy::Stream*) →* FutureOr*>*}, :async_op_then, :async_op_error, :async_op) in null; - if(:controller.{asy::_AsyncStarStreamController::addStream}(_in::unsafeCast*>(:result)){(asy::Stream) → core::bool}) + [yield] let dynamic #t56 = asy::_awaitHelper(func*>(self::intStream()){(asy::Stream*) →* FutureOr*>*}, :async_op_then, :async_op_error) in null; + if(:controller.{asy::_AsyncStarStreamController::addStream}(_in::unsafeCast*>(:result_or_exception)){(asy::Stream) → core::bool}) return null; else [yield] null; @@ -675,8 +675,8 @@ static method controlFlow() → dynamic /* originally async */ { return :controller_stream; } :async_temporary_1 = core::_GrowableList::_literal1(42); - [yield] let dynamic #t57 = asy::_awaitHelper(testStream2(){() →* asy::Stream*}.{asy::Stream::toList}(){() →* asy::Future*>*}, :async_op_then, :async_op_error, :async_op) in null; - self::expectList(_in::unsafeCast*>(:async_temporary_1), _in::unsafeCast*>(:result)); + [yield] let dynamic #t57 = asy::_awaitHelper(testStream2(){() →* asy::Stream*}.{asy::Stream::toList}(){() →* asy::Future*>*}, :async_op_then, :async_op_error) in null; + self::expectList(_in::unsafeCast*>(:async_temporary_1), _in::unsafeCast*>(:result_or_exception)); } } } @@ -689,7 +689,7 @@ static method controlFlow() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -701,7 +701,7 @@ static method future(self::future::T* value) (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L17: { @@ -716,7 +716,7 @@ static method future(self::future::T* value) } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -731,7 +731,7 @@ static method intStream() → asy::Stream* /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L18: @@ -764,25 +764,25 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L19: { for (core::int* i = 0; i.{core::num::<}(11){(core::num*) →* core::bool*}; i = i.{core::num::+}(1){(core::num*) →* core::int*}) { - [yield] let dynamic #t58 = asy::_awaitHelper(self::staticMembers(), :async_op_then, :async_op_error, :async_op) in null; - :result; - [yield] let dynamic #t59 = asy::_awaitHelper(self::topLevelMembers(), :async_op_then, :async_op_error, :async_op) in null; - :result; - [yield] let dynamic #t60 = asy::_awaitHelper(self::instanceMembers(), :async_op_then, :async_op_error, :async_op) in null; - :result; - [yield] let dynamic #t61 = asy::_awaitHelper(self::conditionals(), :async_op_then, :async_op_error, :async_op) in null; - :result; - [yield] let dynamic #t62 = asy::_awaitHelper(self::others(), :async_op_then, :async_op_error, :async_op) in null; - :result; - [yield] let dynamic #t63 = asy::_awaitHelper(self::asserts(), :async_op_then, :async_op_error, :async_op) in null; - :result; - [yield] let dynamic #t64 = asy::_awaitHelper(self::controlFlow(), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t58 = asy::_awaitHelper(self::staticMembers(), :async_op_then, :async_op_error) in null; + :result_or_exception; + [yield] let dynamic #t59 = asy::_awaitHelper(self::topLevelMembers(), :async_op_then, :async_op_error) in null; + :result_or_exception; + [yield] let dynamic #t60 = asy::_awaitHelper(self::instanceMembers(), :async_op_then, :async_op_error) in null; + :result_or_exception; + [yield] let dynamic #t61 = asy::_awaitHelper(self::conditionals(), :async_op_then, :async_op_error) in null; + :result_or_exception; + [yield] let dynamic #t62 = asy::_awaitHelper(self::others(), :async_op_then, :async_op_error) in null; + :result_or_exception; + [yield] let dynamic #t63 = asy::_awaitHelper(self::asserts(), :async_op_then, :async_op_error) in null; + :result_or_exception; + [yield] let dynamic #t64 = asy::_awaitHelper(self::controlFlow(), :async_op_then, :async_op_error) in null; + :result_or_exception; } } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -793,7 +793,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/await_in_cascade.dart.weak.transformed.expect b/pkg/front_end/testcases/general/await_in_cascade.dart.weak.transformed.expect index 3dce5257612..3587ac9c7fa 100644 --- a/pkg/front_end/testcases/general/await_in_cascade.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/await_in_cascade.dart.weak.transformed.expect @@ -19,13 +19,13 @@ class C extends core::Object { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { final core::List* #t1 = core::_GrowableList::•(0); - [yield] let dynamic #t2 = asy::_awaitHelper(this.{self::C::_m}(){() →* asy::Future*}, :async_op_then, :async_op_error, :async_op) in null; - #t1.{core::List::add}(_in::unsafeCast(:result)){(core::int*) →* void}; + [yield] let dynamic #t2 = asy::_awaitHelper(this.{self::C::_m}(){() →* asy::Future*}, :async_op_then, :async_op_error) in null; + #t1.{core::List::add}(_in::unsafeCast(:result_or_exception)){(core::int*) →* void}; :return_value = block {} =>#t1; break #L1; } @@ -37,7 +37,7 @@ class C extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -49,7 +49,7 @@ class C extends core::Object { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -64,7 +64,7 @@ class C extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -88,12 +88,12 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t3 = asy::_awaitHelper(new self::C::•().{self::C::m}(){() →* asy::Future*>*}, :async_op_then, :async_op_error, :async_op) in null; - self::expect(42, _in::unsafeCast*>(:result).{core::Iterable::first}{core::int*}); + [yield] let dynamic #t3 = asy::_awaitHelper(new self::C::•().{self::C::m}(){() →* asy::Future*>*}, :async_op_then, :async_op_error) in null; + self::expect(42, _in::unsafeCast*>(:result_or_exception).{core::Iterable::first}{core::int*}); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -103,7 +103,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/bug33196.dart.weak.transformed.expect b/pkg/front_end/testcases/general/bug33196.dart.weak.transformed.expect index 13451535986..a10da8baa5b 100644 --- a/pkg/front_end/testcases/general/bug33196.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/bug33196.dart.weak.transformed.expect @@ -17,7 +17,7 @@ static method returnsString() → FutureOr* /* originally async * (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -32,7 +32,7 @@ static method returnsString() → FutureOr* /* originally async * } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/bug33206.dart.weak.transformed.expect b/pkg/front_end/testcases/general/bug33206.dart.weak.transformed.expect index 8f459390945..1ea3b37a0de 100644 --- a/pkg/front_end/testcases/general/bug33206.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/bug33206.dart.weak.transformed.expect @@ -48,7 +48,7 @@ static method f1() → asy::Future*>* /* originally as (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -63,7 +63,7 @@ static method f1() → asy::Future*>* /* originally as } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -77,7 +77,7 @@ static method f3() → asy::Future* /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -92,7 +92,7 @@ static method f3() → asy::Future* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -106,18 +106,18 @@ static method foo() → asy::Future* /* originally async */ { dynamic :await_ctx_var; dynamic :saved_try_context_var0; self::Y* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { final self::Y* #t1 = new self::Y::•(); - [yield] let dynamic #t2 = asy::_awaitHelper(self::f1(), :async_op_then, :async_op_error, :async_op) in null; - #t1.{self::Y::f}(_in::unsafeCast*>(:result)){(dynamic) →* dynamic}; + [yield] let dynamic #t2 = asy::_awaitHelper(self::f1(), :async_op_then, :async_op_error) in null; + #t1.{self::Y::f}(_in::unsafeCast*>(:result_or_exception)){(dynamic) →* dynamic}; :async_temporary_0 = block { #t1.{self::Y::f}(self::f2()){(dynamic) →* dynamic}; } =>#t1; - [yield] let dynamic #t3 = asy::_awaitHelper(self::f3(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = new self::X::•(_in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result)); + [yield] let dynamic #t3 = asy::_awaitHelper(self::f3(), :async_op_then, :async_op_error) in null; + :return_value = new self::X::•(_in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result_or_exception)); break #L3; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -128,7 +128,7 @@ static method foo() → asy::Future* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -141,12 +141,12 @@ static method main() → asy::Future* /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t4 = asy::_awaitHelper(self::foo(), :async_op_then, :async_op_error, :async_op) in null; - core::print(_in::unsafeCast(:result)); + [yield] let dynamic #t4 = asy::_awaitHelper(self::foo(), :async_op_then, :async_op_error) in null; + core::print(_in::unsafeCast(:result_or_exception)); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -156,7 +156,7 @@ static method main() → asy::Future* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/check_deferred_before_args2.dart.weak.transformed.expect b/pkg/front_end/testcases/general/check_deferred_before_args2.dart.weak.transformed.expect index 5c693306b36..7779f8c1d63 100644 --- a/pkg/front_end/testcases/general/check_deferred_before_args2.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/check_deferred_before_args2.dart.weak.transformed.expect @@ -16,13 +16,13 @@ static method test() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { final core::Object* #t1 = CheckLibraryIsLoaded(lib); - [yield] let dynamic #t2 = asy::_awaitHelper(LoadLibrary(lib), :async_op_then, :async_op_error, :async_op) in null; - def::m(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(LoadLibrary(lib), :async_op_then, :async_op_error) in null; + def::m(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -32,7 +32,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/control_flow_collection_inference.dart.weak.transformed.expect b/pkg/front_end/testcases/general/control_flow_collection_inference.dart.weak.transformed.expect index e74ebe2d879..dfc514de43f 100644 --- a/pkg/front_end/testcases/general/control_flow_collection_inference.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/control_flow_collection_inference.dart.weak.transformed.expect @@ -1955,7 +1955,7 @@ static method testForElementErrors(core::Map* map, core: dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -2284,8 +2284,8 @@ static method testForElementErrors(core::Map* map, core: #L2: while (true) { dynamic #t265 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t266 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t266 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic i = :for-iterator.{asy::_StreamIterator::current}{dynamic}; #t264.{core::List::add}{Invariant}(i){(dynamic) →* void}; } @@ -2294,8 +2294,8 @@ static method testForElementErrors(core::Map* map, core: } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t267 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t267 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::List* list30 = block {} =>#t264; @@ -2310,8 +2310,8 @@ static method testForElementErrors(core::Map* map, core: #L3: while (true) { dynamic #t269 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t270 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t270 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic i = :for-iterator.{asy::_StreamIterator::current}{dynamic}; #t268.{core::Set::add}{Invariant}(i){(dynamic) →* core::bool*}; } @@ -2320,8 +2320,8 @@ static method testForElementErrors(core::Map* map, core: } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t271 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t271 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::Set* set30 = block { @@ -2338,8 +2338,8 @@ static method testForElementErrors(core::Map* map, core: #L4: while (true) { dynamic #t273 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t274 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t274 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic i = :for-iterator.{asy::_StreamIterator::current}{dynamic}; #t272.{core::Map::[]=}{Invariant}("bar", i){(core::String*, dynamic) →* void}; } @@ -2348,8 +2348,8 @@ static method testForElementErrors(core::Map* map, core: } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t275 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t275 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::Map* map30 = block { @@ -2367,8 +2367,8 @@ static method testForElementErrors(core::Map* map, core: #L5: while (true) { dynamic #t277 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t278 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t278 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::int* i = :for-iterator.{asy::_StreamIterator::current}{core::int*}; #t276.{core::List::add}{Invariant}(i){(core::int*) →* void}; } @@ -2377,8 +2377,8 @@ static method testForElementErrors(core::Map* map, core: } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t279 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t279 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::List* list40 = block {} =>#t276; @@ -2394,8 +2394,8 @@ static method testForElementErrors(core::Map* map, core: #L6: while (true) { dynamic #t281 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t282 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t282 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::int* i = :for-iterator.{asy::_StreamIterator::current}{core::int*}; #t280.{core::Set::add}{Invariant}(i){(core::int*) →* core::bool*}; } @@ -2404,8 +2404,8 @@ static method testForElementErrors(core::Map* map, core: } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t283 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t283 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::Set* set40 = block { @@ -2423,8 +2423,8 @@ static method testForElementErrors(core::Map* map, core: #L7: while (true) { dynamic #t285 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t286 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t286 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::int* i = :for-iterator.{asy::_StreamIterator::current}{core::int*}; #t284.{core::Map::[]=}{Invariant}("bar", i){(core::String*, core::int*) →* void}; } @@ -2433,8 +2433,8 @@ static method testForElementErrors(core::Map* map, core: } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t287 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t287 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::Map* map40 = block { @@ -2489,7 +2489,7 @@ static method testForElementErrors(core::Map* map, core: } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.weak.transformed.expect b/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.weak.transformed.expect index cd22de92f35..e4e75cc836a 100644 --- a/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.weak.transformed.expect @@ -28,7 +28,7 @@ static method main() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -41,8 +41,8 @@ static method main() → dynamic /* originally async */ { #L2: while (true) { dynamic #t1 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final dynamic #t3 = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { invalid-expression "pkg/front_end/testcases/general/error_recovery/empty_await_for.dart:3:14: Error: This couldn't be parsed. @@ -55,8 +55,8 @@ static method main() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -68,7 +68,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/flutter_issue64155.dart.weak.transformed.expect b/pkg/front_end/testcases/general/flutter_issue64155.dart.weak.transformed.expect index 946e53180d7..0dcf16eccf2 100644 --- a/pkg/front_end/testcases/general/flutter_issue64155.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/flutter_issue64155.dart.weak.transformed.expect @@ -14,12 +14,12 @@ abstract class TestMixin(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::TestMixin::R* response = _in::unsafeCast(:result_or_exception); self::TestMixin::T* result; if(response is self::Response*) { result = response{self::TestMixin::R* & self::Response* /* '*' & '*' = '*' */}.{self::Response::data}{dynamic} as{TypeError,ForDynamic} self::TestMixin::T*; @@ -46,7 +46,7 @@ abstract class TestMixin* response = _in::unsafeCast*>(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::Response* response = _in::unsafeCast*>(:result_or_exception); core::String* result; if(response is self::Response*) { result = response{self::Response*}.{self::Response::data}{dynamic} as{TypeError,ForDynamic} core::String*; @@ -154,7 +154,7 @@ abstract class _Class1&Object&TestMixin extends core::Object implements self::Te } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -191,12 +191,12 @@ abstract class _Class2&Object&TestMixin extends core::Object implements self::Te core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t3 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error, :async_op) in null; - final self::PagingResponse* response = _in::unsafeCast*>(:result); + [yield] let dynamic #t3 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::PagingResponse* response = _in::unsafeCast*>(:result_or_exception); core::String* result; if(response is self::Response*) { result = response{self::PagingResponse*}.{self::Response::data}{dynamic} as{TypeError,ForDynamic} core::String*; @@ -223,7 +223,7 @@ abstract class _Class2&Object&TestMixin extends core::Object implements self::Te } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/future_or_test.dart.weak.transformed.expect b/pkg/front_end/testcases/general/future_or_test.dart.weak.transformed.expect index e61e5676391..f83341ff799 100644 --- a/pkg/front_end/testcases/general/future_or_test.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/future_or_test.dart.weak.transformed.expect @@ -35,7 +35,7 @@ class B extends core::Object { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -50,7 +50,7 @@ class B extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -78,7 +78,7 @@ class C extends core::Object { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -93,7 +93,7 @@ class C extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/future_return.dart.weak.transformed.expect b/pkg/front_end/testcases/general/future_return.dart.weak.transformed.expect index f0fb90b15ae..33f08d6d4fd 100644 --- a/pkg/front_end/testcases/general/future_return.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/future_return.dart.weak.transformed.expect @@ -50,7 +50,7 @@ static method returnClass() → self::Class* /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -65,7 +65,7 @@ static method returnClass() → self::Class* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -77,7 +77,7 @@ static method returnFutureClass() → asy::Future* /* originally a (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -92,7 +92,7 @@ static method returnFutureClass() → asy::Future* /* originally a } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -104,7 +104,7 @@ static method returnFutureOrClass() → FutureOr* /* originally as (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -119,7 +119,7 @@ static method returnFutureOrClass() → FutureOr* /* originally as } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -131,7 +131,7 @@ static method returnClassFromDynamic() → self::Class* /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -146,7 +146,7 @@ static method returnClassFromDynamic() → self::Class* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -158,7 +158,7 @@ static method returnFutureClassDynamic() → asy::Future* /* origi (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -173,7 +173,7 @@ static method returnFutureClassDynamic() → asy::Future* /* origi } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -185,7 +185,7 @@ static method returnFutureOrClassDynamic() → FutureOr* /* origin (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -200,7 +200,7 @@ static method returnFutureOrClassDynamic() → FutureOr* /* origin } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -212,7 +212,7 @@ static method returnClassFromFutureClass() → self::Class* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { @@ -227,7 +227,7 @@ static method returnClassFromFutureClass() → self::Class* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -239,7 +239,7 @@ static method returnFutureClassFromFutureClass() → asy::Future* (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { @@ -254,7 +254,7 @@ static method returnFutureClassFromFutureClass() → asy::Future* } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -266,7 +266,7 @@ static method returnFutureOrClassFromFutureClass() → FutureOr* / (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { @@ -281,7 +281,7 @@ static method returnFutureOrClassFromFutureClass() → FutureOr* / } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -293,7 +293,7 @@ static method returnClassFromFutureOrClass() → self::Class* /* originally asyn (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { @@ -308,7 +308,7 @@ static method returnClassFromFutureOrClass() → self::Class* /* originally asyn } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -320,7 +320,7 @@ static method returnFutureClassFromFutureOrClass() → asy::Future (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { @@ -335,7 +335,7 @@ static method returnFutureClassFromFutureOrClass() → asy::Future } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -347,7 +347,7 @@ static method returnFutureOrClassFromFutureOrClass() → FutureOr* (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L12: { @@ -362,7 +362,7 @@ static method returnFutureOrClassFromFutureOrClass() → FutureOr* } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -375,34 +375,34 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L13: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::returnClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::returnFutureClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t3 = asy::_awaitHelper(self::returnFutureOrClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t4 = asy::_awaitHelper(self::returnClassFromDynamic(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t5 = asy::_awaitHelper(self::returnFutureClassDynamic(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t6 = asy::_awaitHelper(self::returnFutureOrClassDynamic(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t7 = asy::_awaitHelper(self::returnClassFromFutureClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t8 = asy::_awaitHelper(self::returnFutureClassFromFutureClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t9 = asy::_awaitHelper(self::returnFutureOrClassFromFutureClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t10 = asy::_awaitHelper(self::returnClassFromFutureOrClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t11 = asy::_awaitHelper(self::returnFutureClassFromFutureOrClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t12 = asy::_awaitHelper(self::returnFutureOrClassFromFutureOrClass(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(self::returnClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::returnFutureClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t3 = asy::_awaitHelper(self::returnFutureOrClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t4 = asy::_awaitHelper(self::returnClassFromDynamic(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t5 = asy::_awaitHelper(self::returnFutureClassDynamic(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t6 = asy::_awaitHelper(self::returnFutureOrClassDynamic(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t7 = asy::_awaitHelper(self::returnClassFromFutureClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t8 = asy::_awaitHelper(self::returnFutureClassFromFutureClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t9 = asy::_awaitHelper(self::returnFutureOrClassFromFutureClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t10 = asy::_awaitHelper(self::returnClassFromFutureOrClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t11 = asy::_awaitHelper(self::returnFutureClassFromFutureOrClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t12 = asy::_awaitHelper(self::returnFutureOrClassFromFutureOrClass(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -412,7 +412,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/inferred_void.dart.weak.transformed.expect b/pkg/front_end/testcases/general/inferred_void.dart.weak.transformed.expect index 6528bab96fe..dc58e3dab8a 100644 --- a/pkg/front_end/testcases/general/inferred_void.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/inferred_void.dart.weak.transformed.expect @@ -21,7 +21,7 @@ static method test(core::Iterable iterable, asy::Stream stream) → dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -48,8 +48,8 @@ static method test(core::Iterable iterable, asy::Stream stream) → #L2: while (true) { dynamic #t1 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { void v5 = :for-iterator.{asy::_StreamIterator::current}{void}; {} } @@ -58,8 +58,8 @@ static method test(core::Iterable iterable, asy::Stream stream) → } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -69,8 +69,8 @@ static method test(core::Iterable iterable, asy::Stream stream) → #L3: while (true) { dynamic #t4 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { void v6 = :for-iterator.{asy::_StreamIterator::current}{void}; {} } @@ -79,8 +79,8 @@ static method test(core::Iterable iterable, asy::Stream stream) → } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::List l1 = core::_GrowableList::_literal1(self::method()); @@ -94,7 +94,7 @@ static method test(core::Iterable iterable, asy::Stream stream) → } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/issue38253b.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue38253b.dart.weak.transformed.expect index 9bfa6ab610d..5073c13fd9a 100644 --- a/pkg/front_end/testcases/general/issue38253b.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue38253b.dart.weak.transformed.expect @@ -36,7 +36,7 @@ static field () → Null a = () → Null { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -53,7 +53,7 @@ static field () → Null a = () → Null { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/issue38253c.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue38253c.dart.weak.transformed.expect index ae34a3642e4..d67c66558e9 100644 --- a/pkg/front_end/testcases/general/issue38253c.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue38253c.dart.weak.transformed.expect @@ -32,7 +32,7 @@ static field () → Null a = () → Null { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -44,7 +44,7 @@ static field () → Null a = () → Null { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -61,7 +61,7 @@ static field () → Null a = () → Null { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -78,7 +78,7 @@ static field () → Null a = () → Null { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -92,12 +92,12 @@ static field (dynamic) → asy::Future b = (dynamic f) → asy::Future< core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t1 = asy::_awaitHelper(f, :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t1 = asy::_awaitHelper(f, :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L3; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -108,7 +108,7 @@ static field (dynamic) → asy::Future b = (dynamic f) → asy::Future< } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/general/issue40662.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue40662.dart.weak.transformed.expect index 90be483b2c6..4fef8f9053c 100644 --- a/pkg/front_end/testcases/general/issue40662.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue40662.dart.weak.transformed.expect @@ -21,7 +21,7 @@ static method foo(core::int* x) → dynamic /* originally async */ { core::int* :async_temporary_1; core::List* :async_temporary_2; core::int* :async_temporary_3; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -29,8 +29,8 @@ static method foo(core::int* x) → dynamic /* originally async */ { if(!(x == null)) { :async_temporary_1 = x.{core::num::+}(1){(core::num*) →* core::int*}; :async_temporary_0 = x.{core::num::+}(2){(core::num*) →* core::int*}; - [yield] let dynamic #t1 = asy::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_2 = core::_GrowableList::_literal3(_in::unsafeCast(:async_temporary_1), _in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result)); + [yield] let dynamic #t1 = asy::_awaitHelper(null, :async_op_then, :async_op_error) in null; + :async_temporary_2 = core::_GrowableList::_literal3(_in::unsafeCast(:async_temporary_1), _in::unsafeCast(:async_temporary_0), _in::unsafeCast(:result_or_exception)); } else { :async_temporary_2 = null; @@ -46,7 +46,7 @@ static method foo(core::int* x) → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -59,12 +59,12 @@ static method main() → void /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(self::foo(0), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t2 = asy::_awaitHelper(self::foo(0), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -75,7 +75,7 @@ static method main() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -88,4 +88,4 @@ static method expect(dynamic expected, dynamic actual) → dynamic { Extra constant evaluation status: Evaluated: InstanceInvocation @ org-dartlang-testcase:///issue40662.dart:10:10 -> IntConstant(-1) Evaluated: InstanceInvocation @ org-dartlang-testcase:///issue40662.dart:11:10 -> IntConstant(-1) -Extra constant evaluation: evaluated: 94, effectively constant: 2 +Extra constant evaluation: evaluated: 92, effectively constant: 2 diff --git a/pkg/front_end/testcases/general/issue42615.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue42615.dart.weak.transformed.expect index b0ac0244f8a..3d98e0c83be 100644 --- a/pkg/front_end/testcases/general/issue42615.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue42615.dart.weak.transformed.expect @@ -31,7 +31,7 @@ static method main() → dynamic { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -46,7 +46,7 @@ static method main() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }); diff --git a/pkg/front_end/testcases/general/issue46956.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue46956.dart.weak.transformed.expect index be46445f91d..184f658476a 100644 --- a/pkg/front_end/testcases/general/issue46956.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue46956.dart.weak.transformed.expect @@ -23,7 +23,7 @@ static method test(self::A a) → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -35,7 +35,7 @@ static method test(self::A a) → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -50,11 +50,11 @@ static method test(self::A a) → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; - })(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - final core::String? x = _in::unsafeCast(:result); + })(){() → asy::Future}, :async_op_then, :async_op_error) in null; + final core::String? x = _in::unsafeCast(:result_or_exception); self::bar(x); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -65,7 +65,7 @@ static method test(self::A a) → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -77,7 +77,7 @@ static method test2(self::A a) → dynamic /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -92,7 +92,7 @@ static method test2(self::A a) → dynamic /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/issue47057.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue47057.dart.weak.transformed.expect index e2413bc3065..1e3ff27f3d6 100644 --- a/pkg/front_end/testcases/general/issue47057.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue47057.dart.weak.transformed.expect @@ -13,7 +13,7 @@ static method foo(self::foo::X% x) → asy::Future(self::foo::X% x) → asy::Future _eventStreamController) → dynam dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -29,8 +29,8 @@ static method test(asy::StreamController _eventStreamController) → dynam #L2: while (true) { dynamic #t1 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final void _ = :for-iterator.{asy::_StreamIterator::current}{void}; {} } @@ -39,8 +39,8 @@ static method test(asy::StreamController _eventStreamController) → dynam } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -52,7 +52,7 @@ static method test(asy::StreamController _eventStreamController) → dynam } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/no_such_method_forwarder.dart.weak.transformed.expect b/pkg/front_end/testcases/general/no_such_method_forwarder.dart.weak.transformed.expect index 983f3d411b3..ad020a3cfe2 100644 --- a/pkg/front_end/testcases/general/no_such_method_forwarder.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/no_such_method_forwarder.dart.weak.transformed.expect @@ -17,12 +17,12 @@ class X extends core::Object { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(null, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); core::print("hello"); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -33,7 +33,7 @@ class X extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/regression_flutter51828.dart.weak.transformed.expect b/pkg/front_end/testcases/general/regression_flutter51828.dart.weak.transformed.expect index 3c53c2bb5bf..a6a1585b25a 100644 --- a/pkg/front_end/testcases/general/regression_flutter51828.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/regression_flutter51828.dart.weak.transformed.expect @@ -16,7 +16,7 @@ class A extends core::Object { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -28,7 +28,7 @@ class A extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -55,7 +55,7 @@ class B extends core::Object { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: {} @@ -67,7 +67,7 @@ class B extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -93,16 +93,16 @@ static method main() → dynamic /* originally async */ { dynamic :saved_try_context_var0; self::B* :async_temporary_0; dynamic :async_temporary_1; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { :async_temporary_1 = new self::A::•(); - [yield] let dynamic #t1 = asy::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_1 = _in::unsafeCast(:async_temporary_1).{self::A::foo}(_in::unsafeCast(:result)){(dynamic) →* asy::Future*}; + [yield] let dynamic #t1 = asy::_awaitHelper(null, :async_op_then, :async_op_error) in null; + :async_temporary_1 = _in::unsafeCast(:async_temporary_1).{self::A::foo}(_in::unsafeCast(:result_or_exception)){(dynamic) →* asy::Future*}; :async_temporary_0 = new self::B::•(); - [yield] let dynamic #t2 = asy::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - :return_value = core::_GrowableList::_literal2*>(_in::unsafeCast*>(:async_temporary_1), _in::unsafeCast(:async_temporary_0).{self::B::bar}(_in::unsafeCast(:result)){(dynamic) →* asy::Future*}); + [yield] let dynamic #t2 = asy::_awaitHelper(null, :async_op_then, :async_op_error) in null; + :return_value = core::_GrowableList::_literal2*>(_in::unsafeCast*>(:async_temporary_1), _in::unsafeCast(:async_temporary_0).{self::B::bar}(_in::unsafeCast(:result_or_exception)){(dynamic) →* asy::Future*}); break #L3; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -113,7 +113,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/general/statements.dart.weak.transformed.expect b/pkg/front_end/testcases/general/statements.dart.weak.transformed.expect index df43e6d606c..522ac947304 100644 --- a/pkg/front_end/testcases/general/statements.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/statements.dart.weak.transformed.expect @@ -24,7 +24,7 @@ static method bar(dynamic d) → dynamic /* originally async* */ { dynamic :saved_try_context_var2; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L1: @@ -36,8 +36,8 @@ static method bar(dynamic d) → dynamic /* originally async* */ { #L2: while (true) { dynamic #t1 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic x = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { if(:controller.{asy::_AsyncStarStreamController::add}(x){(dynamic) → core::bool}) @@ -55,8 +55,8 @@ static method bar(dynamic d) → dynamic /* originally async* */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } diff --git a/pkg/front_end/testcases/general/stream_future.dart.weak.transformed.expect b/pkg/front_end/testcases/general/stream_future.dart.weak.transformed.expect index 99d4140fb40..7730f84a803 100644 --- a/pkg/front_end/testcases/general/stream_future.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/stream_future.dart.weak.transformed.expect @@ -42,7 +42,7 @@ static method returnFutureDynamic() → asy::Future* /* originally asyn (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -57,7 +57,7 @@ static method returnFutureDynamic() → asy::Future* /* originally asyn } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -69,7 +69,7 @@ static method returnFutureClass() → asy::Future* /* originally a (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -84,7 +84,7 @@ static method returnFutureClass() → asy::Future* /* originally a } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -97,7 +97,7 @@ static method error() → asy::Stream*>* /* originally as 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: @@ -134,7 +134,7 @@ static method stream() → asy::Stream*>* /* originally a 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L4: @@ -178,7 +178,7 @@ static method main() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -189,8 +189,8 @@ static method main() → dynamic /* originally async */ { #L6: while (true) { dynamic #t1 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { FutureOr* cls = :for-iterator.{asy::_StreamIterator::current}{FutureOr*}; { core::print(cls); @@ -201,8 +201,8 @@ static method main() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription*>?} == null)) { - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -214,7 +214,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.1.expect b/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.1.expect index 1bb3512260c..8967db17316 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.1.expect +++ b/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.1.expect @@ -10,12 +10,12 @@ library from "org-dartlang-test:///libA.dart" as libA { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - dart._internal::unsafeCast(:result); + [yield] let dynamic #t1 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error) in null; + dart._internal::unsafeCast(:result_or_exception); :return_value = "hello"; break #L1; } @@ -27,7 +27,7 @@ library from "org-dartlang-test:///libA.dart" as libA { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -62,12 +62,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = dart.async::_awaitHelper(libA::whatever(), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t2 = dart.async::_awaitHelper(libA::whatever(), :async_op_then, :async_op_error) in null; + :result_or_exception; dart.core::print(#C2); } dart.async::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -78,7 +78,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.2.expect b/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.2.expect index 6a2982cbdb6..0cfec60b0b7 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.2.expect +++ b/pkg/front_end/testcases/incremental/no_outline_change_3.yaml.world.2.expect @@ -10,12 +10,12 @@ library from "org-dartlang-test:///libA.dart" as libA { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - dart._internal::unsafeCast(:result); + [yield] let dynamic #t1 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error) in null; + dart._internal::unsafeCast(:result_or_exception); :return_value = "hello"; break #L1; } @@ -27,7 +27,7 @@ library from "org-dartlang-test:///libA.dart" as libA { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -62,12 +62,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = dart.async::_awaitHelper(libA::whatever(), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t2 = dart.async::_awaitHelper(libA::whatever(), :async_op_then, :async_op_error) in null; + :result_or_exception; dart.core::print(#C2); dart.core::print("Done"); } @@ -79,7 +79,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.1.expect b/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.1.expect index 9d83b084b64..da879b3c53e 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.1.expect +++ b/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.1.expect @@ -28,12 +28,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = dart.async::_awaitHelper(main::whatever(), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t1 = dart.async::_awaitHelper(main::whatever(), :async_op_then, :async_op_error) in null; + :result_or_exception; dart.core::print(#C2); } dart.async::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -44,7 +44,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -57,12 +57,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - dart._internal::unsafeCast(:result); + [yield] let dynamic #t2 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error) in null; + dart._internal::unsafeCast(:result_or_exception); :return_value = "hello"; break #L2; } @@ -74,7 +74,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.2.expect b/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.2.expect index d0bec69b097..44e9e46eb91 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.2.expect +++ b/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.2.expect @@ -28,12 +28,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = dart.async::_awaitHelper(main::whatever(), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t1 = dart.async::_awaitHelper(main::whatever(), :async_op_then, :async_op_error) in null; + :result_or_exception; dart.core::print(#C2); } dart.async::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -44,7 +44,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -57,12 +57,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - dart._internal::unsafeCast(:result); + [yield] let dynamic #t2 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error) in null; + dart._internal::unsafeCast(:result_or_exception); :return_value = "hello!!!"; break #L2; } @@ -74,7 +74,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.3.expect b/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.3.expect index d9b9b9f1b35..ca8efcb40eb 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.3.expect +++ b/pkg/front_end/testcases/incremental/no_outline_change_5.yaml.world.3.expect @@ -28,12 +28,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = dart.async::_awaitHelper(main::whatever(), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t1 = dart.async::_awaitHelper(main::whatever(), :async_op_then, :async_op_error) in null; + :result_or_exception; dart.core::print(#C2); dart.core::print("Done!"); } @@ -45,7 +45,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -58,12 +58,12 @@ library from "org-dartlang-test:///main.dart" as main { dart.core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error, :async_op) in null; - dart._internal::unsafeCast(:result); + [yield] let dynamic #t2 = dart.async::_awaitHelper(null, :async_op_then, :async_op_error) in null; + dart._internal::unsafeCast(:result_or_exception); :return_value = "hello!!!"; break #L2; } @@ -75,7 +75,7 @@ library from "org-dartlang-test:///main.dart" as main { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/async_await.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/async_await.dart.weak.transformed.expect index 7072277d7e2..1e14f9c62ce 100644 --- a/pkg/front_end/testcases/inference/async_await.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/async_await.dart.weak.transformed.expect @@ -35,7 +35,7 @@ static method test() → void /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -57,7 +57,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -72,7 +72,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -84,7 +84,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -99,7 +99,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -111,7 +111,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -126,7 +126,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -138,7 +138,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -153,7 +153,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -165,7 +165,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -180,7 +180,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -192,7 +192,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { @@ -207,7 +207,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -219,7 +219,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { @@ -234,7 +234,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -246,7 +246,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { @@ -261,7 +261,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -273,7 +273,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { @@ -288,7 +288,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -300,7 +300,7 @@ static method test() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { @@ -315,30 +315,30 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } - [yield] let dynamic #t1 = asy::_awaitHelper(x0, :async_op_then, :async_op_error, :async_op) in null; - core::int* y0 = _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(x1, :async_op_then, :async_op_error, :async_op) in null; - core::int* y1 = _in::unsafeCast(:result); - [yield] let dynamic #t3 = asy::_awaitHelper(x2, :async_op_then, :async_op_error, :async_op) in null; - asy::Future* y2 = _in::unsafeCast*>(:result); - [yield] let dynamic #t4 = asy::_awaitHelper(x3, :async_op_then, :async_op_error, :async_op) in null; - FutureOr* y3 = _in::unsafeCast*>(:result); - [yield] let dynamic #t5 = asy::_awaitHelper(x4, :async_op_then, :async_op_error, :async_op) in null; - self::MyFuture* y4 = _in::unsafeCast(:result); - [yield] let dynamic #t6 = asy::_awaitHelper(x5, :async_op_then, :async_op_error, :async_op) in null; - core::int* y5 = _in::unsafeCast(:result); - [yield] let dynamic #t7 = asy::_awaitHelper(x6, :async_op_then, :async_op_error, :async_op) in null; - asy::Future* y6 = _in::unsafeCast*>(:result); - [yield] let dynamic #t8 = asy::_awaitHelper(x7, :async_op_then, :async_op_error, :async_op) in null; - FutureOr* y7 = _in::unsafeCast*>(:result); - [yield] let dynamic #t9 = asy::_awaitHelper(x8, :async_op_then, :async_op_error, :async_op) in null; - self::MyFuture* y8 = _in::unsafeCast(:result); - [yield] let dynamic #t10 = asy::_awaitHelper(x9, :async_op_then, :async_op_error, :async_op) in null; - core::int* y9 = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(x0, :async_op_then, :async_op_error) in null; + core::int* y0 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(x1, :async_op_then, :async_op_error) in null; + core::int* y1 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t3 = asy::_awaitHelper(x2, :async_op_then, :async_op_error) in null; + asy::Future* y2 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t4 = asy::_awaitHelper(x3, :async_op_then, :async_op_error) in null; + FutureOr* y3 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t5 = asy::_awaitHelper(x4, :async_op_then, :async_op_error) in null; + self::MyFuture* y4 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t6 = asy::_awaitHelper(x5, :async_op_then, :async_op_error) in null; + core::int* y5 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t7 = asy::_awaitHelper(x6, :async_op_then, :async_op_error) in null; + asy::Future* y6 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t8 = asy::_awaitHelper(x7, :async_op_then, :async_op_error) in null; + FutureOr* y7 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t9 = asy::_awaitHelper(x8, :async_op_then, :async_op_error) in null; + self::MyFuture* y8 = _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t10 = asy::_awaitHelper(x9, :async_op_then, :async_op_error) in null; + core::int* y9 = _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -348,7 +348,7 @@ static method test() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.weak.transformed.expect index faa27c6f187..15fb18d59e7 100644 --- a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.weak.transformed.expect @@ -15,7 +15,7 @@ static field () →* asy::Future* g = () → asy::Future (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -30,7 +30,7 @@ static field () →* asy::Future* g = () → asy::Future } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.weak.transformed.expect index d131af3e45f..7e432e90f60 100644 --- a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.weak.transformed.expect @@ -11,7 +11,7 @@ static field () →* asy::Future* f = () → asy::Future (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -26,7 +26,7 @@ static field () →* asy::Future* f = () → asy::Future } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.weak.transformed.expect index 516b135d1ee..de99cb207a3 100644 --- a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.weak.transformed.expect @@ -15,7 +15,7 @@ static field () →* asy::Future* g = () → asy::Future (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -30,7 +30,7 @@ static field () →* asy::Future* g = () → asy::Future } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.weak.transformed.expect index ab84cab45bc..c321e3ebe4f 100644 --- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.weak.transformed.expect @@ -16,7 +16,7 @@ static method test() → dynamic { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -37,7 +37,7 @@ static method test() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.weak.transformed.expect index 33452c2432c..81cc3b11198 100644 --- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.weak.transformed.expect @@ -16,7 +16,7 @@ static method test() → dynamic { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -37,7 +37,7 @@ static method test() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.weak.transformed.expect index 35febb498ba..e5f6a326915 100644 --- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.weak.transformed.expect @@ -16,7 +16,7 @@ static method test() → dynamic { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -37,7 +37,7 @@ static method test() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_star.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_star.dart.weak.transformed.expect index 6e67dc62987..2e127fbce85 100644 --- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_star.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_star.dart.weak.transformed.expect @@ -15,7 +15,7 @@ static method test() → dynamic { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L1: diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.weak.transformed.expect index 1ca076e4e69..2f6049410f0 100644 --- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.weak.transformed.expect @@ -15,7 +15,7 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -27,7 +27,7 @@ static method main() → dynamic /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -42,14 +42,14 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; asy::Future* y = f(){() →* asy::Future*}; asy::Future* z = f(){() →* asy::Future*}; - [yield] let dynamic #t1 = asy::_awaitHelper(f(){() →* asy::Future*}, :async_op_then, :async_op_error, :async_op) in null; - core::String* s = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(f(){() →* asy::Future*}, :async_op_then, :async_op_error) in null; + core::String* s = _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -59,7 +59,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.weak.transformed.expect index 0b661847277..6f20ea71bf1 100644 --- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.weak.transformed.expect @@ -15,7 +15,7 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -28,7 +28,7 @@ static method main() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L2: @@ -54,8 +54,8 @@ static method main() → dynamic /* originally async */ { }; asy::Stream* y = f(){() →* asy::Stream*}; asy::Stream* z = f(){() →* asy::Stream*}; - [yield] let dynamic #t1 = asy::_awaitHelper(f(){() →* asy::Stream*}.{asy::Stream::first}{asy::Future*}, :async_op_then, :async_op_error, :async_op) in null; - core::String* s = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(f(){() →* asy::Stream*}.{asy::Stream::first}{asy::Future*}, :async_op_then, :async_op_error) in null; + core::String* s = _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -65,7 +65,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.weak.transformed.expect index ef028bbcd7a..9b64f1cb5f7 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.weak.transformed.expect @@ -15,15 +15,15 @@ static method main() → asy::Future* /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { dynamic d; - [yield] let dynamic #t1 = asy::_awaitHelper(core::_GrowableList::_literal1(d as{TypeError,ForDynamic} core::int*), :async_op_then, :async_op_error, :async_op) in null; - core::List* l0 = _in::unsafeCast*>(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value*>(core::_GrowableList::_literal1(d as{TypeError,ForDynamic} core::int*)), :async_op_then, :async_op_error, :async_op) in null; - core::List* l1 = _in::unsafeCast*>(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(core::_GrowableList::_literal1(d as{TypeError,ForDynamic} core::int*), :async_op_then, :async_op_error) in null; + core::List* l0 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value*>(core::_GrowableList::_literal1(d as{TypeError,ForDynamic} core::int*)), :async_op_then, :async_op_error) in null; + core::List* l1 = _in::unsafeCast*>(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -33,7 +33,7 @@ static method main() → asy::Future* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.weak.transformed.expect index f7624fe8ec6..70f5a697128 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.weak.transformed.expect @@ -71,7 +71,7 @@ static method f() → asy::Future* /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -123,8 +123,8 @@ static method f() → asy::Future* /* originally async */ { #L2: while (true) { dynamic #t3 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic x = :for-iterator.{asy::_StreamIterator::current}{dynamic}; {} } @@ -133,8 +133,8 @@ static method f() → asy::Future* /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -144,8 +144,8 @@ static method f() → asy::Future* /* originally async */ { #L3: while (true) { dynamic #t6 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic x = :for-iterator.{asy::_StreamIterator::current}{dynamic}; {} } @@ -154,8 +154,8 @@ static method f() → asy::Future* /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -165,8 +165,8 @@ static method f() → asy::Future* /* originally async */ { #L4: while (true) { dynamic #t9 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::Object* x = :for-iterator.{asy::_StreamIterator::current}{core::Object*}; {} } @@ -175,8 +175,8 @@ static method f() → asy::Future* /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t11 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t11 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -186,8 +186,8 @@ static method f() → asy::Future* /* originally async */ { #L5: while (true) { dynamic #t12 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t13 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t13 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final dynamic #t14 = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { d = #t14; @@ -198,8 +198,8 @@ static method f() → asy::Future* /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t15 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t15 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -209,8 +209,8 @@ static method f() → asy::Future* /* originally async */ { #L6: while (true) { dynamic #t16 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t17 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t17 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final core::Object* #t18 = :for-iterator.{asy::_StreamIterator::current}{core::Object*}; { o = #t18; @@ -221,8 +221,8 @@ static method f() → asy::Future* /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t19 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t19 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -234,7 +234,7 @@ static method f() → asy::Future* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -250,7 +250,7 @@ static method main() → asy::Future* /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { @@ -282,8 +282,8 @@ static method main() → asy::Future* /* originally async */ { #L8: while (true) { dynamic #t20 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t21 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t21 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::int* x = :for-iterator.{asy::_StreamIterator::current}{core::int*}; {} } @@ -292,8 +292,8 @@ static method main() → asy::Future* /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t22 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t22 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -303,8 +303,8 @@ static method main() → asy::Future* /* originally async */ { #L9: while (true) { dynamic #t23 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t24 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t24 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::int* x = :for-iterator.{asy::_StreamIterator::current}{core::int*}; {} } @@ -313,8 +313,8 @@ static method main() → asy::Future* /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t25 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t25 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -326,7 +326,7 @@ static method main() → asy::Future* /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.weak.transformed.expect index 2c8befb0b70..7f9840f8f35 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.weak.transformed.expect @@ -92,7 +92,7 @@ static method foo() → asy::Stream*>* /* originally asyn 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L1: diff --git a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.weak.transformed.expect index b47ff66a98d..d8e4b15fa5d 100644 --- a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.weak.transformed.expect @@ -16,7 +16,7 @@ static method test() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -35,8 +35,8 @@ static method test() → dynamic /* originally async */ { #L2: while (true) { dynamic #t1 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic x = :for-iterator.{asy::_StreamIterator::current}{dynamic}; {} } @@ -45,8 +45,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::int* y; @@ -66,8 +66,8 @@ static method test() → dynamic /* originally async */ { #L3: while (true) { dynamic #t5 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final dynamic #t7 = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { y = #t7 as{TypeError,ForDynamic} core::int*; @@ -78,8 +78,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -91,7 +91,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_then.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then.dart.weak.transformed.expect index 6786a24f143..1b0b3a6cbc2 100644 --- a/pkg/front_end/testcases/inference/future_then.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then.dart.weak.transformed.expect @@ -44,12 +44,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -60,7 +60,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -73,12 +73,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L2; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -89,7 +89,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -101,7 +101,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -116,7 +116,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -128,7 +128,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -143,7 +143,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -159,7 +159,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -174,7 +174,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -186,7 +186,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -201,7 +201,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_2.dart.weak.transformed.expect index 2f74e115f37..2945796835e 100644 --- a/pkg/front_end/testcases/inference/future_then_2.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_2.dart.weak.transformed.expect @@ -44,12 +44,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -60,7 +60,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -73,12 +73,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L2; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -89,7 +89,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -101,7 +101,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -116,7 +116,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -128,7 +128,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -143,7 +143,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -159,7 +159,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -174,7 +174,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -186,7 +186,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -201,7 +201,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_3.dart.weak.transformed.expect index 7decc2d45fb..d075aa10c81 100644 --- a/pkg/front_end/testcases/inference/future_then_3.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_3.dart.weak.transformed.expect @@ -44,12 +44,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -60,7 +60,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -73,12 +73,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L2; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -89,7 +89,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -101,7 +101,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -116,7 +116,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -128,7 +128,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -143,7 +143,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -159,7 +159,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -174,7 +174,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -186,7 +186,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -201,7 +201,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_4.dart.weak.transformed.expect index 6bc3b03ce80..ecea35520e8 100644 --- a/pkg/front_end/testcases/inference/future_then_4.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_4.dart.weak.transformed.expect @@ -44,12 +44,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -60,7 +60,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -73,12 +73,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L2; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -89,7 +89,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -101,7 +101,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -116,7 +116,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -128,7 +128,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -143,7 +143,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -159,7 +159,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -174,7 +174,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -186,7 +186,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -201,7 +201,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_5.dart.weak.transformed.expect index 4971cd61130..4c59d38e887 100644 --- a/pkg/front_end/testcases/inference/future_then_5.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_5.dart.weak.transformed.expect @@ -44,12 +44,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -60,7 +60,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -73,12 +73,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L2; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -89,7 +89,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -101,7 +101,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -116,7 +116,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -128,7 +128,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -143,7 +143,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -159,7 +159,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -174,7 +174,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -186,7 +186,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -201,7 +201,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_6.dart.weak.transformed.expect index 7cffed81bfa..fdde0792017 100644 --- a/pkg/front_end/testcases/inference/future_then_6.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_6.dart.weak.transformed.expect @@ -44,12 +44,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -60,7 +60,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -73,12 +73,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception); break #L2; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -89,7 +89,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -101,7 +101,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -116,7 +116,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -128,7 +128,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -143,7 +143,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -159,7 +159,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -174,7 +174,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -186,7 +186,7 @@ static method test() → void { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -201,7 +201,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((dynamic) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.weak.transformed.expect index be1084c083d..ca269fcba30 100644 --- a/pkg/front_end/testcases/inference/future_then_conditional.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.weak.transformed.expect @@ -45,7 +45,7 @@ static method test() → void { dynamic :await_ctx_var; dynamic :saved_try_context_var0; core::int* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -53,8 +53,8 @@ static method test() → void { :async_temporary_0 = 2; } else { - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); } :return_value = _in::unsafeCast(:async_temporary_0); break #L1; @@ -67,7 +67,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -80,12 +80,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; - :return_value = (_in::unsafeCast(:result) ?{core::Object*} 2 : asy::Future::value(3)) as{TypeError} FutureOr*; + [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error) in null; + :return_value = (_in::unsafeCast(:result_or_exception) ?{core::Object*} 2 : asy::Future::value(3)) as{TypeError} FutureOr*; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -96,7 +96,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.weak.transformed.expect index 4327ac543fe..d41c46d98e5 100644 --- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.weak.transformed.expect @@ -45,7 +45,7 @@ static method test() → void { dynamic :await_ctx_var; dynamic :saved_try_context_var0; core::int* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -53,8 +53,8 @@ static method test() → void { :async_temporary_0 = 2; } else { - [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); } :return_value = _in::unsafeCast(:async_temporary_0); break #L1; @@ -67,7 +67,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -80,12 +80,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; - :return_value = (_in::unsafeCast(:result) ?{core::Object*} 2 : new self::MyFuture::value(3)) as{TypeError} FutureOr*; + [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error) in null; + :return_value = (_in::unsafeCast(:result_or_exception) ?{core::Object*} 2 : new self::MyFuture::value(3)) as{TypeError} FutureOr*; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -96,7 +96,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.weak.transformed.expect index 477a40679d9..353cbccd613 100644 --- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.weak.transformed.expect @@ -45,7 +45,7 @@ static method test() → void { dynamic :await_ctx_var; dynamic :saved_try_context_var0; core::int* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -53,8 +53,8 @@ static method test() → void { :async_temporary_0 = 2; } else { - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); } :return_value = _in::unsafeCast(:async_temporary_0); break #L1; @@ -67,7 +67,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -80,12 +80,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; - :return_value = (_in::unsafeCast(:result) ?{core::Object*} 2 : asy::Future::value(3)) as{TypeError} FutureOr*; + [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error) in null; + :return_value = (_in::unsafeCast(:result_or_exception) ?{core::Object*} 2 : asy::Future::value(3)) as{TypeError} FutureOr*; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -96,7 +96,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.weak.transformed.expect index 02116041011..fa9b07f8a7d 100644 --- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.weak.transformed.expect @@ -45,7 +45,7 @@ static method test() → void { dynamic :await_ctx_var; dynamic :saved_try_context_var0; core::int* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -53,8 +53,8 @@ static method test() → void { :async_temporary_0 = 2; } else { - [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); } :return_value = _in::unsafeCast(:async_temporary_0); break #L1; @@ -67,7 +67,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -80,12 +80,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; - :return_value = (_in::unsafeCast(:result) ?{core::Object*} 2 : new self::MyFuture::value(3)) as{TypeError} FutureOr*; + [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error) in null; + :return_value = (_in::unsafeCast(:result_or_exception) ?{core::Object*} 2 : new self::MyFuture::value(3)) as{TypeError} FutureOr*; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -96,7 +96,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.weak.transformed.expect index 6759525c54b..862a14659cb 100644 --- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.weak.transformed.expect @@ -45,7 +45,7 @@ static method test() → void { dynamic :await_ctx_var; dynamic :saved_try_context_var0; core::int* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -53,8 +53,8 @@ static method test() → void { :async_temporary_0 = 2; } else { - [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value(3), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); } :return_value = _in::unsafeCast(:async_temporary_0); break #L1; @@ -67,7 +67,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -80,12 +80,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; - :return_value = (_in::unsafeCast(:result) ?{core::Object*} 2 : new self::MyFuture::value(3)) as{TypeError} FutureOr*; + [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error) in null; + :return_value = (_in::unsafeCast(:result_or_exception) ?{core::Object*} 2 : new self::MyFuture::value(3)) as{TypeError} FutureOr*; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -96,7 +96,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.weak.transformed.expect index 877ea6348af..51cd23d3d36 100644 --- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.weak.transformed.expect @@ -45,7 +45,7 @@ static method test() → void { dynamic :await_ctx_var; dynamic :saved_try_context_var0; core::int* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -53,8 +53,8 @@ static method test() → void { :async_temporary_0 = 2; } else { - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); } :return_value = _in::unsafeCast(:async_temporary_0); break #L1; @@ -67,7 +67,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; @@ -80,12 +80,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; - :return_value = (_in::unsafeCast(:result) ?{core::Object*} 2 : asy::Future::value(3)) as{TypeError} FutureOr*; + [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error) in null; + :return_value = (_in::unsafeCast(:result_or_exception) ?{core::Object*} 2 : asy::Future::value(3)) as{TypeError} FutureOr*; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -96,7 +96,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::bool*) →* FutureOr*, {onError: core::Function*}) →* asy::Future*}; diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.weak.transformed.expect index 2716550b8e2..59febc892f6 100644 --- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.weak.transformed.expect @@ -45,14 +45,14 @@ static method test() → void { dynamic :await_ctx_var; dynamic :saved_try_context_var0; core::int* :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { final core::int* #t1 = x; if(#t1 == null) { - [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error, :async_op) in null; - :async_temporary_0 = _in::unsafeCast(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value(3), :async_op_then, :async_op_error) in null; + :async_temporary_0 = _in::unsafeCast(:result_or_exception); } else { :async_temporary_0 = #t1; @@ -68,7 +68,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::int*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; @@ -81,12 +81,12 @@ static method test() → void { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t3 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; - :return_value = (let final core::int* #t4 = _in::unsafeCast(:result) in #t4 == null ?{core::Object*} asy::Future::value(3) : #t4) as{TypeError} FutureOr*; + [yield] let dynamic #t3 = asy::_awaitHelper(x, :async_op_then, :async_op_error) in null; + :return_value = (let final core::int* #t4 = _in::unsafeCast(:result_or_exception) in #t4 == null ?{core::Object*} asy::Future::value(3) : #t4) as{TypeError} FutureOr*; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -97,7 +97,7 @@ static method test() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }){((core::int*) →* FutureOr*, {onError: core::Function*}) →* self::MyFuture*}; diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.weak.transformed.expect index 2dc93c68238..ea1b07feef9 100644 --- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.weak.transformed.expect @@ -40,7 +40,7 @@ static method g1(core::bool* x) → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -55,7 +55,7 @@ static method g1(core::bool* x) → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -67,7 +67,7 @@ static method g2(core::bool* x) → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -82,7 +82,7 @@ static method g2(core::bool* x) → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -94,7 +94,7 @@ static method g3(core::bool* x) → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -110,7 +110,7 @@ static method g3(core::bool* x) → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.weak.transformed.expect index e56689ee413..110e697b504 100644 --- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.weak.transformed.expect @@ -40,7 +40,7 @@ static method g1(core::bool* x) → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -55,7 +55,7 @@ static method g1(core::bool* x) → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -67,7 +67,7 @@ static method g2(core::bool* x) → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -82,7 +82,7 @@ static method g2(core::bool* x) → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -94,7 +94,7 @@ static method g3(core::bool* x) → asy::Future* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -110,7 +110,7 @@ static method g3(core::bool* x) → asy::Future* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.weak.transformed.expect index 955a495d6aa..8d75a91f32d 100644 --- a/pkg/front_end/testcases/inference/future_union_downwards.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.weak.transformed.expect @@ -52,7 +52,7 @@ static method g2() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -67,7 +67,7 @@ static method g2() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -79,7 +79,7 @@ static method g3() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -94,7 +94,7 @@ static method g3() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.weak.transformed.expect index 9c426f7e265..c18f5d9c59b 100644 --- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.weak.transformed.expect @@ -43,7 +43,7 @@ static method g2() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -58,7 +58,7 @@ static method g2() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -70,7 +70,7 @@ static method g3() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -85,7 +85,7 @@ static method g3() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.weak.transformed.expect index 09a8df9becb..e17a236d9e1 100644 --- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.weak.transformed.expect @@ -52,7 +52,7 @@ static method g2() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -67,7 +67,7 @@ static method g2() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -79,7 +79,7 @@ static method g3() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -94,7 +94,7 @@ static method g3() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.weak.transformed.expect index 35a737222b9..87fe01a1f13 100644 --- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.weak.transformed.expect @@ -43,7 +43,7 @@ static method g2() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -58,7 +58,7 @@ static method g2() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -70,7 +70,7 @@ static method g3() → asy::Future*>* /* originally async (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -85,7 +85,7 @@ static method g3() → asy::Future*>* /* originally async } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.weak.transformed.expect index e617289a9b2..719fe87e196 100644 --- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.weak.transformed.expect @@ -30,14 +30,14 @@ static method foo() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { asy::Future*>* f1 = null; asy::Future*>* f2 = null; - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::wait*>(core::_GrowableList::_literal2*>*>(f1, f2)), :async_op_then, :async_op_error, :async_op) in null; - core::List*>* merged = _in::unsafeCast*>>(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::wait*>(core::_GrowableList::_literal2*>*>(f1, f2)), :async_op_then, :async_op_error) in null; + core::List*>* merged = _in::unsafeCast*>>(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -47,7 +47,7 @@ static method foo() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.weak.transformed.expect index 241a603ba1c..289f3bf778d 100644 --- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.weak.transformed.expect @@ -17,13 +17,13 @@ static method test() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { asy::Future* f; - [yield] let dynamic #t1 = asy::_awaitHelper(self::id*>(f), :async_op_then, :async_op_error, :async_op) in null; - core::String* s = _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(self::id*>(f), :async_op_then, :async_op_error) in null; + core::String* s = _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -33,7 +33,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.weak.transformed.expect index 3e7e7b1ba5b..0045a576f39 100644 --- a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.weak.transformed.expect @@ -40,17 +40,17 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { asy::Future* b = asy::Future::value(new self::B::•()); asy::Future* c = asy::Future::value(new self::C::•()); core::List*>* lll = core::_GrowableList::_literal2*>(b, c); - [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::wait(lll), :async_op_then, :async_op_error, :async_op) in null; - core::List* result = _in::unsafeCast>(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::wait(core::_GrowableList::_literal2*>(b, c)), :async_op_then, :async_op_error, :async_op) in null; - core::List* result2 = _in::unsafeCast>(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::wait(lll), :async_op_then, :async_op_error) in null; + core::List* result = _in::unsafeCast>(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::wait(core::_GrowableList::_literal2*>(b, c)), :async_op_then, :async_op_error) in null; + core::List* result2 = _in::unsafeCast>(:result_or_exception); core::List* list = result; list = result2; } @@ -62,7 +62,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/generator_closure.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/generator_closure.dart.weak.transformed.expect index 304c78c8334..add860f9c2a 100644 --- a/pkg/front_end/testcases/inference/generator_closure.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/generator_closure.dart.weak.transformed.expect @@ -16,7 +16,7 @@ static method main() → void { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L1: diff --git a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.weak.transformed.expect index 9c54557557a..afb8f443fbc 100644 --- a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.weak.transformed.expect @@ -14,7 +14,7 @@ static method test() → dynamic { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -29,7 +29,7 @@ static method test() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -44,7 +44,7 @@ static method test() → dynamic { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -59,7 +59,7 @@ static method test() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -89,7 +89,7 @@ static method test() → dynamic { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.weak.transformed.expect index 8eee676bdac..f060c757bc9 100644 --- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.weak.transformed.expect @@ -67,7 +67,7 @@ class Bar*> extends core::Object { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -78,8 +78,8 @@ class Bar*> extends core::Object { #L2: while (true) { dynamic #t1 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::String* i = :for-iterator.{asy::_StreamIterator::current}{core::String*}; { core::int* x = invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:17:44: Error: A value of type 'String' can't be assigned to a variable of type 'int'. @@ -92,8 +92,8 @@ class Bar*> extends core::Object { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -105,7 +105,7 @@ class Bar*> extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -136,7 +136,7 @@ class Baz}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { self::Baz::T* i = :for-iterator.{asy::_StreamIterator::current}{self::Baz::T*}; { core::int* x = invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:25:44: Error: A value of type 'T' can't be assigned to a variable of type 'int'. @@ -162,8 +162,8 @@ class Baz?} == null)) { - [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -175,7 +175,7 @@ class Baz}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { self::Foo* x = :for-iterator.{asy::_StreamIterator::current}{self::Foo*}; { core::String* y = invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:38:45: Error: A value of type 'Foo' can't be assigned to a variable of type 'String'. @@ -280,8 +280,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t9 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t9 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -291,8 +291,8 @@ static method test() → dynamic /* originally async */ { #L7: while (true) { dynamic #t10 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t11 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t11 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic x = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { core::String* y = x as{TypeError,ForDynamic} core::String*; @@ -303,8 +303,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -314,8 +314,8 @@ static method test() → dynamic /* originally async */ { #L8: while (true) { dynamic #t13 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t14 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t14 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final self::Foo* #t15 = :for-iterator.{asy::_StreamIterator::current}{self::Foo*}; { core::String* x = invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:45:21: Error: A value of type 'Foo' can't be assigned to a variable of type 'String'. @@ -331,8 +331,8 @@ Try changing the type of the variable. } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t16 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t16 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } dynamic z; @@ -343,8 +343,8 @@ Try changing the type of the variable. #L9: while (true) { dynamic #t17 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final self::Foo* #t19 = :for-iterator.{asy::_StreamIterator::current}{self::Foo*}; { z = #t19; @@ -356,8 +356,8 @@ Try changing the type of the variable. } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } asy::Stream* stream = myStream; @@ -368,8 +368,8 @@ Try changing the type of the variable. #L10: while (true) { dynamic #t21 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t22 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t22 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final dynamic #t23 = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { self::Foo* x = #t23 as{TypeError,ForDynamic} self::Foo*; @@ -381,8 +381,8 @@ Try changing the type of the variable. } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t24 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t24 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } dynamic stream2 = myStream; @@ -393,8 +393,8 @@ Try changing the type of the variable. #L11: while (true) { dynamic #t25 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t26 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t26 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final dynamic #t27 = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { self::Foo* x = #t27 as{TypeError,ForDynamic} self::Foo*; @@ -406,8 +406,8 @@ Try changing the type of the variable. } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t28 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t28 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::Map* map = {}; @@ -423,8 +423,8 @@ Try changing the type of the variable. #L12: while (true) { dynamic #t29 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t30 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t30 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic x = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { core::String* y = x as{TypeError,ForDynamic} core::String*; @@ -435,8 +435,8 @@ Try changing the type of the variable. } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t31 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t31 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -448,7 +448,7 @@ Try changing the type of the variable. } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.weak.transformed.expect index 1b776650d05..285cb478eef 100644 --- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.weak.transformed.expect @@ -26,7 +26,7 @@ static method main() → dynamic { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -44,7 +44,7 @@ static method main() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -91,7 +91,7 @@ static method main() → dynamic { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L2: @@ -124,7 +124,7 @@ static method main() → dynamic { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.weak.transformed.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.weak.transformed.expect index 9f7346ab89a..d7f66be1a0c 100644 --- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.weak.transformed.expect @@ -25,7 +25,7 @@ static method b() → asy::Future<(core::int*) →* core::int*>* /* originally a (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -43,7 +43,7 @@ static method b() → asy::Future<(core::int*) →* core::int*>* /* originally a } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -90,7 +90,7 @@ static method e() → asy::Stream<(core::int*) →* core::int*>* /* originally a 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L2: @@ -123,7 +123,7 @@ static method f() → asy::Stream<(core::int*) →* core::int*>* /* originally a 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: diff --git a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.weak.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.weak.transformed.expect index dfc471b580c..2eaaf2a6f22 100644 --- a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.weak.transformed.expect @@ -39,7 +39,7 @@ static method test() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -66,8 +66,8 @@ static method test() → dynamic /* originally async */ { #L2: while (true) { dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final dynamic #t4 = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { core::int* x = #t4 as{TypeError,ForDynamic} core::int*; @@ -78,8 +78,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } core::int* y; @@ -105,8 +105,8 @@ static method test() → dynamic /* originally async */ { #L3: while (true) { dynamic #t7 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final dynamic #t9 = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { y = #t9 as{TypeError,ForDynamic} core::int*; @@ -117,8 +117,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -130,7 +130,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.weak.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.weak.transformed.expect index 356e2de817a..703f7d82016 100644 --- a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.weak.transformed.expect @@ -55,7 +55,7 @@ static method test() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -80,8 +80,8 @@ static method test() → dynamic /* originally async */ { #L2: while (true) { dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final self::A* #t4 = :for-iterator.{asy::_StreamIterator::current}{self::A*}; { a = #t4; @@ -92,8 +92,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -112,8 +112,8 @@ static method test() → dynamic /* originally async */ { #L3: while (true) { dynamic #t7 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final self::A* #t9 = :for-iterator.{asy::_StreamIterator::current}{self::A*}; { b = #t9 as{TypeError} self::B*; @@ -124,8 +124,8 @@ static method test() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -148,8 +148,8 @@ Try changing the type of the variable. #L4: while (true) { dynamic #t12 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t13 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t13 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final self::A* #t14 = :for-iterator.{asy::_StreamIterator::current}{self::A*}; { i = invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:27:16: Error: A value of type 'A' can't be assigned to a variable of type 'int'. @@ -164,8 +164,8 @@ Try changing the type of the variable. } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t15 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t15 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } { @@ -184,8 +184,8 @@ Try changing the type of the variable. #L5: while (true) { dynamic #t17 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final self::A* #t19 = :for-iterator.{asy::_StreamIterator::current}{self::A*}; { a = #t19; @@ -196,8 +196,8 @@ Try changing the type of the variable. } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } } @@ -209,7 +209,7 @@ Try changing the type of the variable. } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect b/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect index 5b963bfd311..5595103f11f 100644 --- a/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect @@ -148,7 +148,7 @@ static method hest() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -159,8 +159,8 @@ static method hest() → dynamic /* originally async */ { #L2: while (true) { dynamic #t6 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::String s = :for-iterator.{asy::_StreamIterator::current}{core::String}; { core::print(s); @@ -171,8 +171,8 @@ static method hest() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } :return_value = "hest"; @@ -186,7 +186,7 @@ static method hest() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -198,7 +198,7 @@ static method fisk() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -227,12 +227,12 @@ static method fisk() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t12 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t12 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L4; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -243,7 +243,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } : #t11{core::Function}; @@ -258,7 +258,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -270,4 +270,4 @@ constants { Extra constant evaluation status: Evaluated: VariableGet @ org-dartlang-testcase:///later.dart:46:18 -> IntConstant(42) -Extra constant evaluation: evaluated: 204, effectively constant: 1 +Extra constant evaluation: evaluated: 201, effectively constant: 1 diff --git a/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect index c37645430e1..7d0a057afbc 100644 --- a/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect @@ -168,7 +168,7 @@ static method hest() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -179,8 +179,8 @@ static method hest() → dynamic /* originally async */ { #L2: while (true) { dynamic #t6 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::String s = :for-iterator.{asy::_StreamIterator::current}{core::String}; { core::print(s); @@ -191,8 +191,8 @@ static method hest() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } :return_value = "hest"; @@ -206,7 +206,7 @@ static method hest() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -218,7 +218,7 @@ static method fisk() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -265,12 +265,12 @@ static method fisk() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t9 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t9 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L4; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -281,7 +281,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -302,7 +302,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.strong.transformed.expect index 663f7f77040..2b23c4c7e9b 100644 --- a/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.strong.transformed.expect @@ -280,7 +280,7 @@ Try changing the type of the variable. (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -310,7 +310,7 @@ Try changing the type of the variable. } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -414,7 +414,7 @@ static method boz(Null x) → self::A { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -442,7 +442,7 @@ static method boz(Null x) → self::A { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.weak.transformed.expect index 374fc97750f..90f48aa9101 100644 --- a/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/assignability_error_messages.dart.weak.transformed.expect @@ -280,7 +280,7 @@ Try changing the type of the variable. (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -310,7 +310,7 @@ Try changing the type of the variable. } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -414,7 +414,7 @@ static method boz(Null x) → self::A { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -442,7 +442,7 @@ static method boz(Null x) → self::A { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.strong.transformed.expect index 64a9400e94d..2c07b454c02 100644 --- a/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.strong.transformed.expect @@ -14,12 +14,12 @@ abstract class TestMixin(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::TestMixin::R% response = _in::unsafeCast(:result_or_exception); self::TestMixin::T% result; if(response is{ForNonNullableByDefault} self::Response) { result = response{self::TestMixin::R% & self::Response /* '%' & '!' = '!' */}.{self::Response::data}{dynamic} as{TypeError,ForDynamic,ForNonNullableByDefault} self::TestMixin::T%; @@ -46,7 +46,7 @@ abstract class TestMixin response = _in::unsafeCast>(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::Response response = _in::unsafeCast>(:result_or_exception); core::String result; if(response is{ForNonNullableByDefault} self::Response) { result = response{self::Response}.{self::Response::data}{dynamic} as{TypeError,ForDynamic,ForNonNullableByDefault} core::String; @@ -114,7 +114,7 @@ abstract class _Class1&Object&TestMixin extends core::Object implements self::Te } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -141,12 +141,12 @@ abstract class _Class2&Object&TestMixin extends core::Object implements self::Te core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t3 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error, :async_op) in null; - final self::PagingResponse response = _in::unsafeCast>(:result); + [yield] let dynamic #t3 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::PagingResponse response = _in::unsafeCast>(:result_or_exception); core::String result; if(response is{ForNonNullableByDefault} self::Response) { result = response{self::PagingResponse}.{self::Response::data}{dynamic} as{TypeError,ForDynamic,ForNonNullableByDefault} core::String; @@ -173,7 +173,7 @@ abstract class _Class2&Object&TestMixin extends core::Object implements self::Te } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.weak.transformed.expect index 64a9400e94d..2c07b454c02 100644 --- a/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/flutter_issue64155.dart.weak.transformed.expect @@ -14,12 +14,12 @@ abstract class TestMixin(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::TestMixin::R% response = _in::unsafeCast(:result_or_exception); self::TestMixin::T% result; if(response is{ForNonNullableByDefault} self::Response) { result = response{self::TestMixin::R% & self::Response /* '%' & '!' = '!' */}.{self::Response::data}{dynamic} as{TypeError,ForDynamic,ForNonNullableByDefault} self::TestMixin::T%; @@ -46,7 +46,7 @@ abstract class TestMixin response = _in::unsafeCast>(:result); + [yield] let dynamic #t2 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::Response response = _in::unsafeCast>(:result_or_exception); core::String result; if(response is{ForNonNullableByDefault} self::Response) { result = response{self::Response}.{self::Response::data}{dynamic} as{TypeError,ForDynamic,ForNonNullableByDefault} core::String; @@ -114,7 +114,7 @@ abstract class _Class1&Object&TestMixin extends core::Object implements self::Te } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -141,12 +141,12 @@ abstract class _Class2&Object&TestMixin extends core::Object implements self::Te core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t3 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error, :async_op) in null; - final self::PagingResponse response = _in::unsafeCast>(:result); + [yield] let dynamic #t3 = asy::_awaitHelper(fetch, :async_op_then, :async_op_error) in null; + final self::PagingResponse response = _in::unsafeCast>(:result_or_exception); core::String result; if(response is{ForNonNullableByDefault} self::Response) { result = response{self::PagingResponse}.{self::Response::data}{dynamic} as{TypeError,ForDynamic,ForNonNullableByDefault} core::String; @@ -173,7 +173,7 @@ abstract class _Class2&Object&TestMixin extends core::Object implements self::Te } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41108.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41108.dart.strong.transformed.expect index 1ecce4a7e30..3911f568301 100644 --- a/pkg/front_end/testcases/nnbd/issue41108.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41108.dart.strong.transformed.expect @@ -21,15 +21,15 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::l(), :async_op_then, :async_op_error, :async_op) in null; + [yield] let dynamic #t1 = asy::_awaitHelper(self::l(), :async_op_then, :async_op_error) in null; core::List y = invalid-expression "pkg/front_end/testcases/nnbd/issue41108.dart:6:12: Error: A value of type 'List?' can't be assigned to a variable of type 'List' because 'List?' is nullable and 'List' isn't. - 'List' is from 'dart:core'. List y = await l(); // should be a List? - ^" in let core::List? #t2 = _in::unsafeCast?>(:result) in #t2 == null ?{core::List} #t2 as{TypeError,ForNonNullableByDefault} core::List : #t2{core::List}; + ^" in let core::List? #t2 = _in::unsafeCast?>(:result_or_exception) in #t2 == null ?{core::List} #t2 as{TypeError,ForNonNullableByDefault} core::List : #t2{core::List}; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -39,7 +39,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41108.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41108.dart.weak.transformed.expect index 1a6d93fa705..c8d68d42e95 100644 --- a/pkg/front_end/testcases/nnbd/issue41108.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41108.dart.weak.transformed.expect @@ -21,15 +21,15 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::l(), :async_op_then, :async_op_error, :async_op) in null; + [yield] let dynamic #t1 = asy::_awaitHelper(self::l(), :async_op_then, :async_op_error) in null; core::List y = invalid-expression "pkg/front_end/testcases/nnbd/issue41108.dart:6:12: Error: A value of type 'List?' can't be assigned to a variable of type 'List' because 'List?' is nullable and 'List' isn't. - 'List' is from 'dart:core'. List y = await l(); // should be a List? - ^" in _in::unsafeCast?>(:result); + ^" in _in::unsafeCast?>(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -39,7 +39,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect index ec795d374fa..5a8290ab9d6 100644 --- a/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect @@ -11,7 +11,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -28,7 +28,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect index ec795d374fa..5a8290ab9d6 100644 --- a/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect @@ -11,7 +11,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -28,7 +28,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect index d45e9905567..8190be562c9 100644 --- a/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect @@ -63,7 +63,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -78,7 +78,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -90,7 +90,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -104,7 +104,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -116,7 +116,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -131,7 +131,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -143,7 +143,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -158,7 +158,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -170,7 +170,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -184,7 +184,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -196,7 +196,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -211,7 +211,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -224,7 +224,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { @@ -276,7 +276,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { @@ -298,7 +298,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -310,7 +310,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { @@ -333,7 +333,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -345,7 +345,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { @@ -367,7 +367,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -379,7 +379,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { @@ -402,7 +402,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -415,7 +415,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect index 90dabf33082..69eb4d9c01f 100644 --- a/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect @@ -64,7 +64,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -79,7 +79,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -91,7 +91,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -105,7 +105,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -117,7 +117,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -132,7 +132,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -144,7 +144,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -159,7 +159,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -171,7 +171,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -185,7 +185,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -197,7 +197,7 @@ static method main() → void { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -212,7 +212,7 @@ static method main() → void { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -225,7 +225,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { @@ -277,7 +277,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { @@ -299,7 +299,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -311,7 +311,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { @@ -334,7 +334,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -346,7 +346,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { @@ -368,7 +368,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -380,7 +380,7 @@ static method errors() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { @@ -403,7 +403,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -416,7 +416,7 @@ static method errors() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect index ed3a3ca2d0b..6e2c362a811 100644 --- a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect @@ -41,7 +41,7 @@ static method getFutureNull() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -56,7 +56,7 @@ static method getFutureNull() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -68,7 +68,7 @@ static method getFutureBool() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -83,7 +83,7 @@ static method getFutureBool() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -96,12 +96,12 @@ static method test1() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L3; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -112,7 +112,7 @@ static method test1() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -129,12 +129,12 @@ static method test4() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t2 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t2 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L4; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -145,7 +145,7 @@ static method test4() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -164,7 +164,7 @@ static method test7() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -179,7 +179,7 @@ static method test7() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -191,7 +191,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -204,12 +204,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { - [yield] let dynamic #t3 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t3 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L7; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -220,7 +220,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -237,12 +237,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { - [yield] let dynamic #t4 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t4 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L8; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -253,7 +253,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -272,7 +272,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { @@ -287,7 +287,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -303,12 +303,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { - [yield] let dynamic #t5 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t5 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L10; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -319,7 +319,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future} as{TypeError,ForNonNullableByDefault} asy::Future; @@ -337,12 +337,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { - [yield] let dynamic #t6 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t6 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L11; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -353,7 +353,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future} as{TypeError,ForNonNullableByDefault} asy::Future; @@ -370,7 +370,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L12: { @@ -385,7 +385,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future}; @@ -398,7 +398,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect index ed3a3ca2d0b..6e2c362a811 100644 --- a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect @@ -41,7 +41,7 @@ static method getFutureNull() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -56,7 +56,7 @@ static method getFutureNull() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -68,7 +68,7 @@ static method getFutureBool() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -83,7 +83,7 @@ static method getFutureBool() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -96,12 +96,12 @@ static method test1() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L3; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -112,7 +112,7 @@ static method test1() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -129,12 +129,12 @@ static method test4() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t2 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t2 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L4; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -145,7 +145,7 @@ static method test4() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -164,7 +164,7 @@ static method test7() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -179,7 +179,7 @@ static method test7() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -191,7 +191,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -204,12 +204,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { - [yield] let dynamic #t3 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t3 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L7; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -220,7 +220,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -237,12 +237,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { - [yield] let dynamic #t4 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; + [yield] let dynamic #t4 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr; break #L8; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -253,7 +253,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -272,7 +272,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { @@ -287,7 +287,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -303,12 +303,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { - [yield] let dynamic #t5 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t5 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L10; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -319,7 +319,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future} as{TypeError,ForNonNullableByDefault} asy::Future; @@ -337,12 +337,12 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { - [yield] let dynamic #t6 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t6 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L11; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -353,7 +353,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future} as{TypeError,ForNonNullableByDefault} asy::Future; @@ -370,7 +370,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L12: { @@ -385,7 +385,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future}; @@ -398,7 +398,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect index 8b27a537e02..06df3f06373 100644 --- a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect @@ -150,7 +150,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -292,7 +292,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect index 8b27a537e02..06df3f06373 100644 --- a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect @@ -150,7 +150,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -292,7 +292,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect index 995ecacf0c2..ce8b32e648c 100644 --- a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect @@ -52,7 +52,7 @@ static method getStreamNull() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L1: @@ -85,7 +85,7 @@ static method getStreamBool() → asy::Stream /* originally async* * 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L2: @@ -118,7 +118,7 @@ static method test1() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: @@ -155,7 +155,7 @@ static method test4() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L4: @@ -198,7 +198,7 @@ static method test7() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L5: @@ -230,7 +230,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -243,7 +243,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L7: @@ -280,7 +280,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L8: @@ -323,7 +323,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L9: @@ -359,7 +359,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L10: @@ -397,7 +397,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L11: @@ -435,7 +435,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L12: @@ -468,7 +468,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect index 995ecacf0c2..ce8b32e648c 100644 --- a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect @@ -52,7 +52,7 @@ static method getStreamNull() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L1: @@ -85,7 +85,7 @@ static method getStreamBool() → asy::Stream /* originally async* * 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L2: @@ -118,7 +118,7 @@ static method test1() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: @@ -155,7 +155,7 @@ static method test4() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L4: @@ -198,7 +198,7 @@ static method test7() → asy::Stream /* originally async* */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L5: @@ -230,7 +230,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -243,7 +243,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L7: @@ -280,7 +280,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L8: @@ -323,7 +323,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L9: @@ -359,7 +359,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L10: @@ -397,7 +397,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L11: @@ -435,7 +435,7 @@ static method test() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L12: @@ -468,7 +468,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect index ec6e4be2f1d..675b14da468 100644 --- a/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect @@ -23,7 +23,7 @@ static method returnFutureOfVoid() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -35,7 +35,7 @@ static method returnFutureOfVoid() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -48,7 +48,7 @@ static method returnVoidAsync() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: {} @@ -60,7 +60,7 @@ static method returnVoidAsync() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -73,14 +73,14 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::returnVoid(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::returnVoidAsync(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(self::returnVoid(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::returnVoidAsync(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -90,7 +90,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -103,12 +103,12 @@ static method main() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t3 = asy::_awaitHelper(self::returnFutureOfVoid(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t3 = asy::_awaitHelper(self::returnFutureOfVoid(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -118,7 +118,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect index ec6e4be2f1d..675b14da468 100644 --- a/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect @@ -23,7 +23,7 @@ static method returnFutureOfVoid() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -35,7 +35,7 @@ static method returnFutureOfVoid() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -48,7 +48,7 @@ static method returnVoidAsync() → void /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: {} @@ -60,7 +60,7 @@ static method returnVoidAsync() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -73,14 +73,14 @@ static method test() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::returnVoid(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::returnVoidAsync(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(self::returnVoid(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::returnVoidAsync(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -90,7 +90,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -103,12 +103,12 @@ static method main() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t3 = asy::_awaitHelper(self::returnFutureOfVoid(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t3 = asy::_awaitHelper(self::returnFutureOfVoid(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -118,7 +118,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.strong.transformed.expect index b845eb912b0..1c73ad9dcba 100644 --- a/pkg/front_end/testcases/nnbd/issue41697.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41697.dart.strong.transformed.expect @@ -43,12 +43,12 @@ static method test1(self::C c) → dynamic { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result).{core::num::+}(1){(core::num) → core::num}; + [yield] let dynamic #t1 = asy::_awaitHelper(t, :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception).{core::num::+}(1){(core::num) → core::num}; break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -59,7 +59,7 @@ static method test1(self::C c) → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -79,14 +79,14 @@ static method test2(self::C c) → dynamic { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null; + [yield] let dynamic #t2 = asy::_awaitHelper(t, :async_op_then, :async_op_error) in null; :return_value = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null. return (await t) + 1; // error - ^" in _in::unsafeCast(:result).{core::num::+}(1){(core::num) → core::num}; + ^" in _in::unsafeCast(:result_or_exception).{core::num::+}(1){(core::num) → core::num}; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -97,7 +97,7 @@ static method test2(self::C c) → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.weak.transformed.expect index b845eb912b0..1c73ad9dcba 100644 --- a/pkg/front_end/testcases/nnbd/issue41697.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue41697.dart.weak.transformed.expect @@ -43,12 +43,12 @@ static method test1(self::C c) → dynamic { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null; - :return_value = _in::unsafeCast(:result).{core::num::+}(1){(core::num) → core::num}; + [yield] let dynamic #t1 = asy::_awaitHelper(t, :async_op_then, :async_op_error) in null; + :return_value = _in::unsafeCast(:result_or_exception).{core::num::+}(1){(core::num) → core::num}; break #L1; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -59,7 +59,7 @@ static method test1(self::C c) → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -79,14 +79,14 @@ static method test2(self::C c) → dynamic { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t2 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null; + [yield] let dynamic #t2 = asy::_awaitHelper(t, :async_op_then, :async_op_error) in null; :return_value = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null. return (await t) + 1; // error - ^" in _in::unsafeCast(:result).{core::num::+}(1){(core::num) → core::num}; + ^" in _in::unsafeCast(:result_or_exception).{core::num::+}(1){(core::num) → core::num}; break #L2; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -97,7 +97,7 @@ static method test2(self::C c) → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/nnbd/issue42540.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue42540.dart.strong.transformed.expect index 2bb4719a2fb..2b136ded4b1 100644 --- a/pkg/front_end/testcases/nnbd/issue42540.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue42540.dart.strong.transformed.expect @@ -14,14 +14,14 @@ static method fn() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - core::Object o = let dynamic #t2 = :result in #t2 == null ?{core::Object} #t2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::Object : #t2{core::Object}; - [yield] let dynamic #t3 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = let dynamic #t4 = :result in #t4 == null ?{FutureOr} #t4 as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr : #t4{FutureOr}; + [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + core::Object o = let dynamic #t2 = :result_or_exception in #t2 == null ?{core::Object} #t2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::Object : #t2{core::Object}; + [yield] let dynamic #t3 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = let dynamic #t4 = :result_or_exception in #t4 == null ?{FutureOr} #t4 as{TypeError,ForDynamic,ForNonNullableByDefault} FutureOr : #t4{FutureOr}; break #L1; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -32,7 +32,7 @@ static method fn() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue42540.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue42540.dart.weak.transformed.expect index 4d5ecd6f0a2..74c03659f3d 100644 --- a/pkg/front_end/testcases/nnbd/issue42540.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue42540.dart.weak.transformed.expect @@ -14,14 +14,14 @@ static method fn() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - core::Object o = :result; - [yield] let dynamic #t2 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t1 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + core::Object o = :result_or_exception; + [yield] let dynamic #t2 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L1; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -32,7 +32,7 @@ static method fn() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue42546.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue42546.dart.strong.transformed.expect index fe3f0747eca..e5489e177e5 100644 --- a/pkg/front_end/testcases/nnbd/issue42546.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue42546.dart.strong.transformed.expect @@ -45,7 +45,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -61,7 +61,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -80,7 +80,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future>>>} as{TypeError,ForNonNullableByDefault} asy::Future>>; @@ -93,7 +93,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue42546.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue42546.dart.weak.transformed.expect index fe3f0747eca..e5489e177e5 100644 --- a/pkg/front_end/testcases/nnbd/issue42546.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue42546.dart.weak.transformed.expect @@ -45,7 +45,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -61,7 +61,7 @@ static method test() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -80,7 +80,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; })(){() → asy::Future>>>} as{TypeError,ForNonNullableByDefault} asy::Future>>; @@ -93,7 +93,7 @@ static method test() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue42743.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue42743.dart.strong.transformed.expect index ce053819b2c..199ae9bd65c 100644 --- a/pkg/front_end/testcases/nnbd/issue42743.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue42743.dart.strong.transformed.expect @@ -11,7 +11,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -28,7 +28,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -45,7 +45,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -58,7 +58,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue42743.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue42743.dart.weak.transformed.expect index ce053819b2c..199ae9bd65c 100644 --- a/pkg/front_end/testcases/nnbd/issue42743.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue42743.dart.weak.transformed.expect @@ -11,7 +11,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -28,7 +28,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -45,7 +45,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -58,7 +58,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue44595.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue44595.dart.strong.transformed.expect index 83b083cfa58..0bf212b7014 100644 --- a/pkg/front_end/testcases/nnbd/issue44595.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue44595.dart.strong.transformed.expect @@ -20,7 +20,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -40,7 +40,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/issue44595.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue44595.dart.weak.transformed.expect index 83b083cfa58..0bf212b7014 100644 --- a/pkg/front_end/testcases/nnbd/issue44595.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/issue44595.dart.weak.transformed.expect @@ -20,7 +20,7 @@ static method main() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -40,7 +40,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect index 5d5407b24e1..c26058bf257 100644 --- a/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect @@ -135,7 +135,7 @@ static method hest() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -146,8 +146,8 @@ static method hest() → dynamic /* originally async */ { #L2: while (true) { dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::String s = :for-iterator.{asy::_StreamIterator::current}{core::String}; { core::print(s); @@ -158,8 +158,8 @@ static method hest() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } :return_value = "hest"; @@ -173,7 +173,7 @@ static method hest() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -185,7 +185,7 @@ static method fisk() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -209,12 +209,12 @@ static method fisk() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t5 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t5 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L4; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -225,7 +225,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -239,7 +239,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect index 5d5407b24e1..c26058bf257 100644 --- a/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect @@ -135,7 +135,7 @@ static method hest() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -146,8 +146,8 @@ static method hest() → dynamic /* originally async */ { #L2: while (true) { dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { core::String s = :for-iterator.{asy::_StreamIterator::current}{core::String}; { core::print(s); @@ -158,8 +158,8 @@ static method hest() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } :return_value = "hest"; @@ -173,7 +173,7 @@ static method hest() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -185,7 +185,7 @@ static method fisk() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -209,12 +209,12 @@ static method fisk() → dynamic /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { - [yield] let dynamic #t5 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error, :async_op) in null; - :return_value = :result; + [yield] let dynamic #t5 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error) in null; + :return_value = :result_or_exception; break #L4; } asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -225,7 +225,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }; @@ -239,7 +239,7 @@ static method fisk() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/return_async.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/return_async.dart.strong.transformed.expect index 765a6948c62..8e3b2c14419 100644 --- a/pkg/front_end/testcases/nnbd/return_async.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/return_async.dart.strong.transformed.expect @@ -18,14 +18,14 @@ static method allYield() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(0, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::allYield2(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(0, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::allYield2(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -35,7 +35,7 @@ static method allYield() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -48,14 +48,14 @@ static method allYield2() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t3 = asy::_awaitHelper(0, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t4 = asy::_awaitHelper(self::allYield3(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t3 = asy::_awaitHelper(0, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t4 = asy::_awaitHelper(self::allYield3(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -65,7 +65,7 @@ static method allYield2() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -78,12 +78,12 @@ static method allYield3() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t5 = asy::_awaitHelper(0, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t5 = asy::_awaitHelper(0, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); self::throwSync(); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -94,7 +94,7 @@ static method allYield3() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -106,7 +106,7 @@ static method customErrorZone() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -120,12 +120,12 @@ static method customErrorZone() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { - [yield] let dynamic #t6 = asy::_awaitHelper(self::allYield(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t6 = asy::_awaitHelper(self::allYield(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); completer.{asy::Completer::complete}(null){([FutureOr?]) → void}; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -136,7 +136,7 @@ static method customErrorZone() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }, (core::Object e, core::StackTrace s) → void { @@ -153,7 +153,7 @@ static method customErrorZone() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/return_async.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/return_async.dart.weak.transformed.expect index 765a6948c62..8e3b2c14419 100644 --- a/pkg/front_end/testcases/nnbd/return_async.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/return_async.dart.weak.transformed.expect @@ -18,14 +18,14 @@ static method allYield() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { - [yield] let dynamic #t1 = asy::_awaitHelper(0, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::allYield2(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(0, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::allYield2(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -35,7 +35,7 @@ static method allYield() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -48,14 +48,14 @@ static method allYield2() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { - [yield] let dynamic #t3 = asy::_awaitHelper(0, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t4 = asy::_awaitHelper(self::allYield3(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t3 = asy::_awaitHelper(0, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t4 = asy::_awaitHelper(self::allYield3(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -65,7 +65,7 @@ static method allYield2() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -78,12 +78,12 @@ static method allYield3() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t5 = asy::_awaitHelper(0, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t5 = asy::_awaitHelper(0, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); self::throwSync(); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -94,7 +94,7 @@ static method allYield3() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -106,7 +106,7 @@ static method customErrorZone() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -120,12 +120,12 @@ static method customErrorZone() → asy::Future /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { - [yield] let dynamic #t6 = asy::_awaitHelper(self::allYield(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t6 = asy::_awaitHelper(self::allYield(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); completer.{asy::Completer::complete}(null){([FutureOr?]) → void}; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -136,7 +136,7 @@ static method customErrorZone() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; }, (core::Object e, core::StackTrace s) → void { @@ -153,7 +153,7 @@ static method customErrorZone() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect index 2bde6d6ddf0..f464a2fad83 100644 --- a/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect @@ -99,7 +99,7 @@ static method returnAsync1() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -111,7 +111,7 @@ static method returnAsync1() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -123,7 +123,7 @@ static method returnAsync2() → FutureOr /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: {} @@ -135,7 +135,7 @@ static method returnAsync2() → FutureOr /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -147,7 +147,7 @@ static method returnAsync3() → FutureOr /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -164,7 +164,7 @@ FutureOr returnAsync3() async {} // error } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -176,7 +176,7 @@ static method returnAsync4() → FutureOr /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: {} @@ -188,7 +188,7 @@ static method returnAsync4() → FutureOr /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -200,7 +200,7 @@ static method returnAsync5() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: {} @@ -212,7 +212,7 @@ static method returnAsync5() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -224,7 +224,7 @@ static method returnAsync6() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -239,7 +239,7 @@ static method returnAsync6() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -251,7 +251,7 @@ static method returnAsync7() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: {} @@ -263,7 +263,7 @@ static method returnAsync7() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -286,7 +286,7 @@ static method yieldAsync() → asy::Stream /* originally async* */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L8: @@ -367,7 +367,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L13: {} @@ -379,7 +379,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -391,7 +391,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L14: {} @@ -403,7 +403,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -415,7 +415,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L15: { @@ -432,7 +432,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -444,7 +444,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L16: {} @@ -456,7 +456,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -468,7 +468,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L17: {} @@ -480,7 +480,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -492,7 +492,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L18: { @@ -507,7 +507,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -519,7 +519,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L19: {} @@ -531,7 +531,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -554,7 +554,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L20: diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect index 16befe0c1af..09a90f205c5 100644 --- a/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect @@ -100,7 +100,7 @@ static method returnAsync1() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -112,7 +112,7 @@ static method returnAsync1() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -124,7 +124,7 @@ static method returnAsync2() → FutureOr /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: {} @@ -136,7 +136,7 @@ static method returnAsync2() → FutureOr /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -148,7 +148,7 @@ static method returnAsync3() → FutureOr /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -165,7 +165,7 @@ FutureOr returnAsync3() async {} // error } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -177,7 +177,7 @@ static method returnAsync4() → FutureOr /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: {} @@ -189,7 +189,7 @@ static method returnAsync4() → FutureOr /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -201,7 +201,7 @@ static method returnAsync5() → dynamic /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: {} @@ -213,7 +213,7 @@ static method returnAsync5() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -225,7 +225,7 @@ static method returnAsync6() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { @@ -240,7 +240,7 @@ static method returnAsync6() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -252,7 +252,7 @@ static method returnAsync7() → asy::Future /* originally async */ (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: {} @@ -264,7 +264,7 @@ static method returnAsync7() → asy::Future /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -287,7 +287,7 @@ static method yieldAsync() → asy::Stream /* originally async* */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L8: @@ -371,7 +371,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L14: {} @@ -383,7 +383,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -395,7 +395,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L15: {} @@ -407,7 +407,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -419,7 +419,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L16: { @@ -436,7 +436,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -448,7 +448,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L17: {} @@ -460,7 +460,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -472,7 +472,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L18: {} @@ -484,7 +484,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -496,7 +496,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L19: { @@ -511,7 +511,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -523,7 +523,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L20: {} @@ -535,7 +535,7 @@ static method localFunctions() → dynamic { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -558,7 +558,7 @@ static method localFunctions() → dynamic { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L21: diff --git a/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect index 160716b7a67..19c9552f541 100644 --- a/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect @@ -12,7 +12,7 @@ static method returnFutureOfVoid() → asy::Future* /* originally async */ (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: {} @@ -24,7 +24,7 @@ static method returnFutureOfVoid() → asy::Future* /* originally async */ } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -37,7 +37,7 @@ static method returnVoidAsync() → void /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: {} @@ -49,7 +49,7 @@ static method returnVoidAsync() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -62,16 +62,16 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { - [yield] let dynamic #t1 = asy::_awaitHelper(self::returnVoid(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::returnFutureOfVoid(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); - [yield] let dynamic #t3 = asy::_awaitHelper(self::returnVoidAsync(), :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + [yield] let dynamic #t1 = asy::_awaitHelper(self::returnVoid(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::returnFutureOfVoid(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); + [yield] let dynamic #t3 = asy::_awaitHelper(self::returnVoidAsync(), :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -81,7 +81,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/nnbd_mixed/typedef_from_opt_in.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd_mixed/typedef_from_opt_in.dart.weak.transformed.expect index 1f53e963920..055f5afa4c7 100644 --- a/pkg/front_end/testcases/nnbd_mixed/typedef_from_opt_in.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd_mixed/typedef_from_opt_in.dart.weak.transformed.expect @@ -15,7 +15,7 @@ static method method1() → (typ::Request*) →* FutureOr* (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -30,7 +30,7 @@ static method method1() → (typ::Request*) →* FutureOr* } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; }; diff --git a/pkg/front_end/testcases/regress/issue_34850.dart.weak.transformed.expect b/pkg/front_end/testcases/regress/issue_34850.dart.weak.transformed.expect index b4b664dde28..44637256e5e 100644 --- a/pkg/front_end/testcases/regress/issue_34850.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/regress/issue_34850.dart.weak.transformed.expect @@ -67,7 +67,7 @@ static method f2() → dynamic /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -82,7 +82,7 @@ static method f2() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -94,7 +94,7 @@ static method f3() → invalid-type /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -109,7 +109,7 @@ static method f3() → invalid-type /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -122,15 +122,15 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { core::print(self::f1()); - [yield] let dynamic #t1 = asy::_awaitHelper(self::f2(), :async_op_then, :async_op_error, :async_op) in null; - core::print(:result); - [yield] let dynamic #t2 = asy::_awaitHelper(self::f3(), :async_op_then, :async_op_error, :async_op) in null; - core::print(_in::unsafeCast(:result)); + [yield] let dynamic #t1 = asy::_awaitHelper(self::f2(), :async_op_then, :async_op_error) in null; + core::print(:result_or_exception); + [yield] let dynamic #t2 = asy::_awaitHelper(self::f3(), :async_op_then, :async_op_error) in null; + core::print(_in::unsafeCast(:result_or_exception)); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -140,7 +140,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/regress/issue_37681.dart.weak.transformed.expect b/pkg/front_end/testcases/regress/issue_37681.dart.weak.transformed.expect index 63a99de0895..2048398dd41 100644 --- a/pkg/front_end/testcases/regress/issue_37681.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/regress/issue_37681.dart.weak.transformed.expect @@ -31,7 +31,7 @@ static method main() → dynamic /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -43,7 +43,7 @@ static method main() → dynamic /* originally async */ { (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -58,12 +58,12 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } - [yield] let dynamic #t1 = asy::_awaitHelper(f_async(){() →* core::int*}, :async_op_then, :async_op_error, :async_op) in null; - core::print(_in::unsafeCast(:result)); + [yield] let dynamic #t1 = asy::_awaitHelper(f_async(){() →* core::int*}, :async_op_then, :async_op_error) in null; + core::print(_in::unsafeCast(:result_or_exception)); function f_async_star() → core::int* /* originally async* */ { asy::_AsyncStarStreamController* :controller; dynamic :controller_stream; @@ -73,7 +73,7 @@ static method main() → dynamic /* originally async */ { 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L3: @@ -104,8 +104,8 @@ static method main() → dynamic /* originally async */ { #L4: while (true) { dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { dynamic x = :for-iterator.{asy::_StreamIterator::current}{dynamic}; { core::print(x); @@ -116,8 +116,8 @@ static method main() → dynamic /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } function f_sync_star() → core::int* /* originally sync* */ { @@ -155,7 +155,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.weak.transformed.expect b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.weak.transformed.expect index 9262980ac51..15787235cf4 100644 --- a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.weak.transformed.expect @@ -62,7 +62,7 @@ static method main() → dynamic /* originally async */ { core::int* :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -87,26 +87,26 @@ Change the type of the set literal or the context in which it is used. Change the type of the map literal or the context in which it is used. LinkedHashMap lhm = {}; ^" in {}; - [yield] let dynamic #t4 = asy::_awaitHelper(self::mapfun(), :async_op_then, :async_op_error, :async_op) in null; - core::Map* fm = _in::unsafeCast*>(:result); - [yield] let dynamic #t5 = asy::_awaitHelper(self::setfun(), :async_op_then, :async_op_error, :async_op) in null; - core::Set* fs = _in::unsafeCast*>(:result); - [yield] let dynamic #t6 = asy::_awaitHelper(self::iterablefun(), :async_op_then, :async_op_error, :async_op) in null; - core::Iterable* fi = _in::unsafeCast*>(:result); - [yield] let dynamic #t7 = asy::_awaitHelper(self::lhsfun(), :async_op_then, :async_op_error, :async_op) in null; - col::LinkedHashSet* flhs = _in::unsafeCast*>(:result); - [yield] let dynamic #t8 = asy::_awaitHelper(self::lhmfun(), :async_op_then, :async_op_error, :async_op) in null; - col::LinkedHashMap* flhm = _in::unsafeCast*>(:result); - [yield] let dynamic #t9 = asy::_awaitHelper(self::mapfun2(), :async_op_then, :async_op_error, :async_op) in null; - core::Map* fm2 = _in::unsafeCast*>(:result); - [yield] let dynamic #t10 = asy::_awaitHelper(self::setfun2(), :async_op_then, :async_op_error, :async_op) in null; - core::Set* fs2 = _in::unsafeCast*>(:result); - [yield] let dynamic #t11 = asy::_awaitHelper(self::iterablefun2(), :async_op_then, :async_op_error, :async_op) in null; - core::Iterable* fi2 = _in::unsafeCast*>(:result); - [yield] let dynamic #t12 = asy::_awaitHelper(self::lhsfun2(), :async_op_then, :async_op_error, :async_op) in null; - col::LinkedHashSet* flhs2 = _in::unsafeCast*>(:result); - [yield] let dynamic #t13 = asy::_awaitHelper(self::lhmfun2(), :async_op_then, :async_op_error, :async_op) in null; - col::LinkedHashMap* flhm2 = _in::unsafeCast*>(:result); + [yield] let dynamic #t4 = asy::_awaitHelper(self::mapfun(), :async_op_then, :async_op_error) in null; + core::Map* fm = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t5 = asy::_awaitHelper(self::setfun(), :async_op_then, :async_op_error) in null; + core::Set* fs = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t6 = asy::_awaitHelper(self::iterablefun(), :async_op_then, :async_op_error) in null; + core::Iterable* fi = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t7 = asy::_awaitHelper(self::lhsfun(), :async_op_then, :async_op_error) in null; + col::LinkedHashSet* flhs = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t8 = asy::_awaitHelper(self::lhmfun(), :async_op_then, :async_op_error) in null; + col::LinkedHashMap* flhm = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t9 = asy::_awaitHelper(self::mapfun2(), :async_op_then, :async_op_error) in null; + core::Map* fm2 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t10 = asy::_awaitHelper(self::setfun2(), :async_op_then, :async_op_error) in null; + core::Set* fs2 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t11 = asy::_awaitHelper(self::iterablefun2(), :async_op_then, :async_op_error) in null; + core::Iterable* fi2 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t12 = asy::_awaitHelper(self::lhsfun2(), :async_op_then, :async_op_error) in null; + col::LinkedHashSet* flhs2 = _in::unsafeCast*>(:result_or_exception); + [yield] let dynamic #t13 = asy::_awaitHelper(self::lhmfun2(), :async_op_then, :async_op_error) in null; + col::LinkedHashMap* flhm2 = _in::unsafeCast*>(:result_or_exception); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -116,7 +116,7 @@ Change the type of the map literal or the context in which it is used. } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -128,7 +128,7 @@ static method mapfun() → asy::Future*>* /* (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -143,7 +143,7 @@ static method mapfun() → asy::Future*>* /* } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -155,7 +155,7 @@ static method setfun() → asy::Future*>* /* originally as (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -172,7 +172,7 @@ static method setfun() → asy::Future*>* /* originally as } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -184,7 +184,7 @@ static method iterablefun() → asy::Future*>* /* ori (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -201,7 +201,7 @@ static method iterablefun() → asy::Future*>* /* ori } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -213,7 +213,7 @@ static method lhsfun() → asy::Future*>* /* orig (core::Object*, core::StackTrace*) →* dynamic :async_op_error; core::int* :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -236,7 +236,7 @@ Future> lhsfun() async => {}; } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } @@ -248,7 +248,7 @@ static method lhmfun() → asy::Future> lhmfun() async => {}; } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() →* dynamic}; + :async_op(null, null){() →* dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/kernel/lib/transformations/async.dart b/pkg/kernel/lib/transformations/async.dart index acca81a70cb..a9d5f6ac116 100644 --- a/pkg/kernel/lib/transformations/async.dart +++ b/pkg/kernel/lib/transformations/async.dart @@ -76,7 +76,8 @@ class ExpressionLifter extends Transformer { /// [nameIndex] may still account for names of subexpressions. int nameIndex = 0; - final VariableDeclaration asyncResult = new VariableDeclaration(':result'); + final VariableDeclaration asyncResult = + new VariableDeclaration(':result_or_exception'); final List variables = []; ExpressionLifter(this.continuationRewriter); @@ -538,7 +539,6 @@ class ExpressionLifter extends Transformer { expr.operand, new VariableGet(R.thenContinuationVariable), new VariableGet(R.catchErrorContinuationVariable), - new VariableGet(R.nestedClosureVariable), ]); // We are building diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart index c0375c2aa73..3fb6474607b 100644 --- a/pkg/kernel/lib/transformations/continuation.dart +++ b/pkg/kernel/lib/transformations/continuation.dart @@ -536,7 +536,7 @@ class SyncStarFunctionRewriter extends ContinuationRewriterBase { } abstract class AsyncRewriterBase extends ContinuationRewriterBase { - // :async_op has type ([dynamic result, dynamic e, StackTrace? s]) -> dynamic + // :async_op has type (dynamic result_or_exception, StackTrace? s) -> dynamic final VariableDeclaration nestedClosureVariable; // :async_op_then has type (dynamic result) -> dynamic @@ -551,14 +551,13 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase { AsyncRewriterBase(HelperNodes helper, FunctionNode enclosingFunction, StatefulStaticTypeContext staticTypeContext) - : nestedClosureVariable = VariableDeclaration( - ContinuationVariables.asyncOp, - type: FunctionType([ - const DynamicType(), - const DynamicType(), - helper.coreTypes.stackTraceRawType(staticTypeContext.nullable), - ], const DynamicType(), staticTypeContext.nonNullable, - requiredParameterCount: 0)), + : nestedClosureVariable = + VariableDeclaration(ContinuationVariables.asyncOp, + type: FunctionType([ + const DynamicType(), + helper.coreTypes + .stackTraceRawType(staticTypeContext.nullable), + ], const DynamicType(), staticTypeContext.nonNullable)), thenContinuationVariable = VariableDeclaration( ContinuationVariables.asyncOpThen, type: FunctionType(const [const DynamicType()], const DynamicType(), @@ -581,12 +580,11 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase { // var :async_op_error; statements.add(catchErrorContinuationVariable); - // :async_op([:result, :exception, :stack_trace]) { + // :async_op(:result_or_exception, :stack_trace) { // modified ; // } final parameters = [ expressionRewriter!.asyncResult, - new VariableDeclaration(ContinuationVariables.exceptionParam), new VariableDeclaration(ContinuationVariables.stackTraceParam), ]; @@ -595,7 +593,6 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase { // Dart async marker to decide if functions are debuggable.) final function = new FunctionNode(buildWrappedBody(), positionalParameters: parameters, - requiredParameterCount: 0, asyncMarker: AsyncMarker.SyncYielding, dartAsyncMarker: AsyncMarker.Sync) ..fileOffset = enclosingFunction.fileOffset @@ -1413,9 +1410,9 @@ class AsyncFunctionRewriter extends AsyncRewriterBase { valueType.withDeclaredNullability(Nullability.nullable); } - // :async_op(); + // :async_op(null, null); final startStatement = ExpressionStatement(LocalFunctionInvocation( - nestedClosureVariable, Arguments([]), + nestedClosureVariable, Arguments([NullLiteral(), NullLiteral()]), functionType: FunctionType( [], const DynamicType(), staticTypeContext.nonNullable)) ..fileOffset = enclosingFunction.fileOffset); diff --git a/pkg/vm/testcases/transformations/deferred_loading/main.dart.expect b/pkg/vm/testcases/transformations/deferred_loading/main.dart.expect index e063504578a..a8811854916 100644 --- a/pkg/vm/testcases/transformations/deferred_loading/main.dart.expect +++ b/pkg/vm/testcases/transformations/deferred_loading/main.dart.expect @@ -53,7 +53,7 @@ LoadingUnit(id=6, parent=5, (dart.core::Object, dart.core::StackTrace) → dynamic :async_op_error; dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -67,7 +67,7 @@ LoadingUnit(id=6, parent=5, } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -84,7 +84,7 @@ library h from "#pkg/vm/testcases/transformations/deferred_loading/h.dart" as h (dart.core::Object, dart.core::StackTrace) → dynamic :async_op_error; dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -98,7 +98,7 @@ library h from "#pkg/vm/testcases/transformations/deferred_loading/h.dart" as h } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -117,13 +117,13 @@ library i from "#pkg/vm/testcases/transformations/deferred_loading/i.dart" as i dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { dart.core::print("I"); - [yield] let dynamic #t1 = dart.async::_awaitHelper(LoadLibrary(j), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t1 = dart.async::_awaitHelper(LoadLibrary(j), :async_op_then, :async_op_error) in null; + :result_or_exception; :return_value = let final dynamic #t2 = CheckLibraryIsLoaded(j) in j::j(); break #L3; } @@ -135,7 +135,7 @@ library i from "#pkg/vm/testcases/transformations/deferred_loading/i.dart" as i } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -152,7 +152,7 @@ library g from "#pkg/vm/testcases/transformations/deferred_loading/g.dart" as g (dart.core::Object, dart.core::StackTrace) → dynamic :async_op_error; dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { @@ -166,7 +166,7 @@ library g from "#pkg/vm/testcases/transformations/deferred_loading/g.dart" as g } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -185,17 +185,17 @@ library f from "#pkg/vm/testcases/transformations/deferred_loading/f.dart" as f dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { dart.core::print("F"); - [yield] let dynamic #t3 = dart.async::_awaitHelper(LoadLibrary(g), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t3 = dart.async::_awaitHelper(LoadLibrary(g), :async_op_then, :async_op_error) in null; + :result_or_exception; :return_value = let final dynamic #t4 = CheckLibraryIsLoaded(g) in g::g(); break #L5; - [yield] let dynamic #t5 = dart.async::_awaitHelper(LoadLibrary(i), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t5 = dart.async::_awaitHelper(LoadLibrary(i), :async_op_then, :async_op_error) in null; + :result_or_exception; :return_value = let final dynamic #t6 = CheckLibraryIsLoaded(i) in i::i(); break #L5; } @@ -207,7 +207,7 @@ library f from "#pkg/vm/testcases/transformations/deferred_loading/f.dart" as f } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -225,13 +225,13 @@ library e from "#pkg/vm/testcases/transformations/deferred_loading/e.dart" as e dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L6: { dart.core::print("E"); - [yield] let dynamic #t7 = dart.async::_awaitHelper(LoadLibrary(g), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t7 = dart.async::_awaitHelper(LoadLibrary(g), :async_op_then, :async_op_error) in null; + :result_or_exception; :return_value = let final dynamic #t8 = CheckLibraryIsLoaded(g) in g::g(); break #L6; } @@ -243,7 +243,7 @@ library e from "#pkg/vm/testcases/transformations/deferred_loading/e.dart" as e } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -262,13 +262,13 @@ library c from "#pkg/vm/testcases/transformations/deferred_loading/c.dart" as c dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L7: { dart.core::print("C"); - [yield] let dynamic #t9 = dart.async::_awaitHelper(LoadLibrary(f), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t9 = dart.async::_awaitHelper(LoadLibrary(f), :async_op_then, :async_op_error) in null; + :result_or_exception; :return_value = let final dynamic #t10 = CheckLibraryIsLoaded(f) in f::f(); break #L7; } @@ -280,7 +280,7 @@ library c from "#pkg/vm/testcases/transformations/deferred_loading/c.dart" as c } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -297,7 +297,7 @@ library d from "#pkg/vm/testcases/transformations/deferred_loading/d.dart" as d (dart.core::Object, dart.core::StackTrace) → dynamic :async_op_error; dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L8: { @@ -313,7 +313,7 @@ library d from "#pkg/vm/testcases/transformations/deferred_loading/d.dart" as d } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -330,7 +330,7 @@ library b from "#pkg/vm/testcases/transformations/deferred_loading/b.dart" as b (dart.core::Object, dart.core::StackTrace) → dynamic :async_op_error; dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L9: { @@ -346,7 +346,7 @@ library b from "#pkg/vm/testcases/transformations/deferred_loading/b.dart" as b } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -364,13 +364,13 @@ library a from "#pkg/vm/testcases/transformations/deferred_loading/a.dart" as a dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L10: { dart.core::print("A"); - [yield] let dynamic #t11 = dart.async::_awaitHelper(LoadLibrary(d), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t11 = dart.async::_awaitHelper(LoadLibrary(d), :async_op_then, :async_op_error) in null; + :result_or_exception; :return_value = let final dynamic #t12 = CheckLibraryIsLoaded(d) in d::d(); break #L10; } @@ -382,7 +382,7 @@ library a from "#pkg/vm/testcases/transformations/deferred_loading/a.dart" as a } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -401,14 +401,14 @@ library #lib from "#lib" as #lib { dart.core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L11: { - [yield] let dynamic #t13 = dart.async::_awaitHelper(a::a(), :async_op_then, :async_op_error, :async_op) in null; - :result; - [yield] let dynamic #t14 = dart.async::_awaitHelper(b::b(), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t13 = dart.async::_awaitHelper(a::a(), :async_op_then, :async_op_error) in null; + :result_or_exception; + [yield] let dynamic #t14 = dart.async::_awaitHelper(b::b(), :async_op_then, :async_op_error) in null; + :result_or_exception; } dart.async::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -418,7 +418,7 @@ library #lib from "#lib" as #lib { } :async_op_then = dart.async::_asyncThenWrapperHelper(:async_op); :async_op_error = dart.async::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/vm/testcases/transformations/ffi/finalizable_async.dart.expect b/pkg/vm/testcases/transformations/ffi/finalizable_async.dart.expect index f72ce427bf2..e098162a392 100644 --- a/pkg/vm/testcases/transformations/ffi/finalizable_async.dart.expect +++ b/pkg/vm/testcases/transformations/ffi/finalizable_async.dart.expect @@ -19,7 +19,7 @@ class MyFinalizable extends core::Object implements ffi::Finalizable { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -37,7 +37,7 @@ class MyFinalizable extends core::Object implements ffi::Finalizable { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -50,15 +50,15 @@ class MyFinalizable extends core::Object implements ffi::Finalizable { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { [yield] let dynamic #t1 = asy::_awaitHelper( block { final asy::Future :expressionValueWrappedFinalizable = self::doSomething(); _in::reachabilityFence(this); - } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error, :async_op) in null; - final core::int :expressionValueWrappedFinalizable = _in::unsafeCast(:result); + } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error) in null; + final core::int :expressionValueWrappedFinalizable = _in::unsafeCast(:result_or_exception); :return_value = block { _in::reachabilityFence(this); } =>:expressionValueWrappedFinalizable; @@ -72,7 +72,7 @@ class MyFinalizable extends core::Object implements ffi::Finalizable { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -91,7 +91,7 @@ static method doSomething() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { @@ -106,7 +106,7 @@ static method doSomething() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -119,30 +119,30 @@ static method useFinalizableAsync(ffi::Finalizable finalizable) → asy::Future< core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L4: { [yield] let dynamic #t2 = asy::_awaitHelper( block { final asy::Future :expressionValueWrappedFinalizable = asy::Future::sync(() → core::int => 6); _in::reachabilityFence(finalizable); - } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); final self::MyFinalizable finalizable2 = new self::MyFinalizable::•(); [yield] let dynamic #t3 = asy::_awaitHelper( block { final asy::Future :expressionValueWrappedFinalizable = asy::Future::sync(() → core::int => 5); _in::reachabilityFence(finalizable); _in::reachabilityFence(finalizable2); - } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); final self::MyFinalizable finalizable3 = new self::MyFinalizable::•(); [yield] let dynamic #t4 = asy::_awaitHelper( block { final asy::Future :expressionValueWrappedFinalizable = asy::Future::sync(() → core::int => 4); _in::reachabilityFence(finalizable); _in::reachabilityFence(finalizable2); _in::reachabilityFence(finalizable3); - } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); :return_value = block { final asy::Future :expressionValueWrappedFinalizable = self::doSomething(); _in::reachabilityFence(finalizable); @@ -159,7 +159,7 @@ static method useFinalizableAsync(ffi::Finalizable finalizable) → asy::Future< } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -172,7 +172,7 @@ static method main() → void /* originally async */ { core::int :await_jump_var = 0; dynamic :await_ctx_var; dynamic :saved_try_context_var0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L5: { @@ -181,8 +181,8 @@ static method main() → void /* originally async */ { [yield] let dynamic #t5 = asy::_awaitHelper( block { final asy::Future :expressionValueWrappedFinalizable = asyncResult; _in::reachabilityFence(finalizable); - } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error, :async_op) in null; - core::print(_in::unsafeCast(:result)); + } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error) in null; + core::print(_in::unsafeCast(:result_or_exception)); _in::reachabilityFence(finalizable); } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); @@ -193,7 +193,7 @@ static method main() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/vm/testcases/transformations/ffi/finalizable_async_star.dart.expect b/pkg/vm/testcases/transformations/ffi/finalizable_async_star.dart.expect index 01a6c61e0e6..18fae3510fb 100644 --- a/pkg/vm/testcases/transformations/ffi/finalizable_async_star.dart.expect +++ b/pkg/vm/testcases/transformations/ffi/finalizable_async_star.dart.expect @@ -23,7 +23,7 @@ static method useFinalizableAsyncStar(ffi::Finalizable finalizable) → asy::Str 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 + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try try { #L1: @@ -43,8 +43,8 @@ static method useFinalizableAsyncStar(ffi::Finalizable finalizable) → asy::Str _in::reachabilityFence(finalizable); _in::reachabilityFence(finalizable2); _in::reachabilityFence(finalizable3); - } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error, :async_op) in null; - _in::unsafeCast(:result); + } =>:expressionValueWrappedFinalizable, :async_op_then, :async_op_error) in null; + _in::unsafeCast(:result_or_exception); final self::MyFinalizable finalizable4 = new self::MyFinalizable::•(); if(new core::DateTime::now().{core::DateTime::millisecondsSinceEpoch}{core::int} =={core::num::==}{(core::Object) → core::bool} 4) { { @@ -96,7 +96,7 @@ static method main() → void /* originally async */ { dynamic :saved_try_context_var1; dynamic :exception0; dynamic :stack_trace0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -109,8 +109,8 @@ static method main() → void /* originally async */ { #L3: while (true) { dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream); - [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - if(_in::unsafeCast(:result)) { + [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + if(_in::unsafeCast(:result_or_exception)) { final core::int element = :for-iterator.{asy::_StreamIterator::current}{core::int}; { core::print(element); @@ -121,8 +121,8 @@ static method main() → void /* originally async */ { } finally if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription?} == null)) { - [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future}, :async_op_then, :async_op_error) in null; + :result_or_exception; } } _in::reachabilityFence(finalizable); @@ -135,7 +135,7 @@ static method main() → void /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect index 0f8f453fab6..da5be5f8394 100644 --- a/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect +++ b/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect @@ -15,7 +15,7 @@ class A extends core::Object { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L1: { @@ -30,7 +30,7 @@ class A extends core::Object { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -50,7 +50,7 @@ static method baz() → asy::Future /* originally async */ { (core::Object, core::StackTrace) → dynamic :async_op_error; core::int :await_jump_var = 0; dynamic :await_ctx_var; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L2: { @@ -65,7 +65,7 @@ static method baz() → asy::Future /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } @@ -79,14 +79,14 @@ static method main() → dynamic /* originally async */ { dynamic :await_ctx_var; dynamic :saved_try_context_var0; dynamic :async_temporary_0; - function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding + function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding try { #L3: { :async_temporary_0 = [@vm.inferred-type.metadata=#lib::A] self::foo(); - [yield] let dynamic #t1 = asy::_awaitHelper([@vm.inferred-type.metadata=dart.async::_Future] self::baz(), :async_op_then, :async_op_error, :async_op) in null; - [yield] let dynamic #t2 = asy::_awaitHelper([@vm.direct-call.metadata=#lib::A.bar??] [@vm.inferred-type.metadata=dart.async::_Future (receiver not int)] :async_temporary_0{dynamic}.bar(:result), :async_op_then, :async_op_error, :async_op) in null; - :result; + [yield] let dynamic #t1 = asy::_awaitHelper([@vm.inferred-type.metadata=dart.async::_Future] self::baz(), :async_op_then, :async_op_error) in null; + [yield] let dynamic #t2 = asy::_awaitHelper([@vm.direct-call.metadata=#lib::A.bar??] [@vm.inferred-type.metadata=dart.async::_Future (receiver not int)] :async_temporary_0{dynamic}.bar(:result_or_exception), :async_op_then, :async_op_error) in null; + :result_or_exception; } asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); return; @@ -96,7 +96,7 @@ static method main() → dynamic /* originally async */ { } :async_op_then = asy::_asyncThenWrapperHelper(:async_op); :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); - :async_op(){() → dynamic}; + :async_op(null, null){() → dynamic}; :is_sync = true; return :async_future; } diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index 4e837875760..b20723b1a0f 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc @@ -5210,36 +5210,35 @@ Fragment StreamingFlowGraphBuilder::BuildYieldStatement( yield_continuations().Add(YieldContinuation(anchor, CurrentTryIndex())); Fragment continuation(instructions.entry, anchor); - RELEASE_ASSERT(parsed_function()->function().IsAsyncClosure() || parsed_function()->function().IsAsyncGenClosure() || parsed_function()->function().IsSyncGenClosure()); // TODO(43900): Only emit this when needed. { - // If function is {async, async gen, sync yielding} closure it takes three - // parameters where the second and the third are exception and stack_trace. - // Check if exception is non-null and rethrow it. + // Our sync-yielding functions can be invoked with either a yield result or + // with an non-null exception & stacktrace. + // + // We detect the case we're in based on the nullability of stacktrace in + // + // :sync_op(:iterator, [:exception, :stack_trace]) { } // - // :sync_op(:iterator, [:exception, :stack_trace]) { // or: - // :async_op(:result, [:exception, :stack_trace]) { - // ... - // Continuation: - // if (:exception != null) rethrow(:exception, :stack_trace); - // ... - // } // - LocalVariable* exception_var = parsed_function()->ParameterVariable(2); - LocalVariable* stack_trace_var = parsed_function()->ParameterVariable(3); - ASSERT(exception_var->name().ptr() == Symbols::ExceptionParameter().ptr()); + // :async_op(:result_or_exception, :stack_trace) { } + // + const auto& fun = parsed_function()->function(); + LocalVariable* exception_var = + parsed_function()->ParameterVariable(fun.IsSyncGenClosure() ? 2 : 1); + LocalVariable* stack_trace_var = + parsed_function()->ParameterVariable(fun.IsSyncGenClosure() ? 3 : 2); ASSERT(stack_trace_var->name().ptr() == Symbols::StackTraceParameter().ptr()); TargetEntryInstr* no_error; TargetEntryInstr* error; - continuation += LoadLocal(exception_var); + continuation += LoadLocal(stack_trace_var); continuation += BranchIfNull(&no_error, &error); Fragment rethrow(/*instruction=*/error); diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h index 778673bbf8a..6c67e4cc9e4 100644 --- a/runtime/vm/compiler/recognized_methods_list.h +++ b/runtime/vm/compiler/recognized_methods_list.h @@ -237,6 +237,7 @@ namespace dart { V(::, _asExternalTypedDataDouble, FfiAsExternalTypedDataDouble, 0x40cdd9e1) \ V(::, _getNativeField, GetNativeField, 0xa0139b85) \ V(::, reachabilityFence, ReachabilityFence, 0x730f2b7f) \ + V(::, _asyncThenWrapperHelper, AsyncThenWrapperHelper, 0xd9974c34) \ V(_Utf8Decoder, _scan, Utf8DecoderScan, 0x1dcaf73d) \ V(_Future, timeout, FutureTimeout, 0x73041520) \ V(Future, wait, FutureWait, 0x495c83cd) \ diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc index 0e97fbb52c5..4e4f9a174b8 100644 --- a/runtime/vm/debugger.cc +++ b/runtime/vm/debugger.cc @@ -1956,11 +1956,15 @@ DebuggerStackTrace* DebuggerStackTrace::CollectAsyncLazy() { const intptr_t length = code_array.Length(); bool async_frames = false; + bool skip_next_gap_marker = false; for (intptr_t i = 0; i < length; ++i) { code ^= code_array.At(i); - if (code.ptr() == StubCode::AsynchronousGapMarker().ptr()) { - stack_trace->AddMarker(ActivationFrame::kAsyncSuspensionMarker); + if (!skip_next_gap_marker) { + stack_trace->AddMarker(ActivationFrame::kAsyncSuspensionMarker); + } + skip_next_gap_marker = false; + // Once we reach a gap, the rest is async. async_frames = true; continue; @@ -1978,6 +1982,7 @@ DebuggerStackTrace* DebuggerStackTrace::CollectAsyncLazy() { // Skip invisible function frames. function ^= code.function(); if (!function.is_visible()) { + skip_next_gap_marker = true; continue; } diff --git a/runtime/vm/stack_trace.cc b/runtime/vm/stack_trace.cc index 583e055612a..0ef8b4d1431 100644 --- a/runtime/vm/stack_trace.cc +++ b/runtime/vm/stack_trace.cc @@ -55,7 +55,8 @@ intptr_t FindPcOffset(const PcDescriptors& pc_descs, intptr_t yield_index) { // Instance caches library and field references. // This way we don't have to do the look-ups for every frame in the stack. CallerClosureFinder::CallerClosureFinder(Zone* zone) - : receiver_context_(Context::Handle(zone)), + : closure_(Closure::Handle(zone)), + receiver_context_(Context::Handle(zone)), receiver_function_(Function::Handle(zone)), parent_function_(Function::Handle(zone)), context_entry_(Object::Handle(zone)), @@ -74,6 +75,7 @@ CallerClosureFinder::CallerClosureFinder(Zone* zone) controller_subscription_class(Class::Handle(zone)), buffering_stream_subscription_class(Class::Handle(zone)), stream_iterator_class(Class::Handle(zone)), + async_then_wrapper_(Function::Handle(zone)), future_result_or_listeners_field(Field::Handle(zone)), callback_field(Field::Handle(zone)), future_listener_state_field(Field::Handle(zone)), @@ -110,6 +112,9 @@ CallerClosureFinder::CallerClosureFinder(Zone* zone) stream_iterator_class = async_lib.LookupClassAllowPrivate(Symbols::_StreamIterator()); ASSERT(!stream_iterator_class.IsNull()); + async_then_wrapper_ = + async_lib.LookupFunctionAllowPrivate(Symbols::AsyncThenWrapperHelper()); + ASSERT(!async_then_wrapper_.IsNull()); // Look up fields: // - async: @@ -210,6 +215,12 @@ ClosurePtr CallerClosureFinder::FindCallerInAsyncGenClosure( ClosurePtr CallerClosureFinder::GetCallerInFutureListener( const Object& future_listener) { + closure_ = GetCallerInFutureListenerInternal(future_listener); + return UnwrapAsyncThen(closure_); +} + +ClosurePtr CallerClosureFinder::GetCallerInFutureListenerInternal( + const Object& future_listener) { auto value = GetFutureListenerState(future_listener); // If the _FutureListener is a `then`, `catchError`, or `whenComplete` @@ -227,6 +238,26 @@ ClosurePtr CallerClosureFinder::GetCallerInFutureListener( } ClosurePtr CallerClosureFinder::FindCaller(const Closure& receiver_closure) { + closure_ = FindCallerInternal(receiver_closure); + return UnwrapAsyncThen(closure_); +} + +ClosurePtr CallerClosureFinder::UnwrapAsyncThen(const Closure& closure) { + if (closure.IsNull()) return closure.ptr(); + + receiver_function_ = closure.function(); + receiver_function_ = receiver_function_.parent_function(); + if (receiver_function_.recognized_kind() == + MethodRecognizer::kAsyncThenWrapperHelper) { + receiver_context_ = closure.context(); + RELEASE_ASSERT(receiver_context_.num_variables() == 1); + return Closure::RawCast(receiver_context_.At(0)); + } + return closure.ptr(); +} + +ClosurePtr CallerClosureFinder::FindCallerInternal( + const Closure& receiver_closure) { receiver_function_ = receiver_closure.function(); receiver_context_ = receiver_closure.context(); @@ -358,23 +389,18 @@ ClosurePtr StackTraceUtils::FindClosureInFrame(ObjectPtr* last_object_in_caller, ASSERT(function.IsAsyncClosure() || function.IsAsyncGenClosure()); // The callee has function signature - // :async_op([result, exception, stack]) - // So we are guaranteed to - // a) have only tagged arguments on the stack until we find the :async_op - // closure, and - // b) find the async closure. - const intptr_t kNumClosureAndArgs = 4; - auto& closure = Closure::Handle(); - for (intptr_t i = 0; i < kNumClosureAndArgs; i++) { - ObjectPtr arg = last_object_in_caller[i]; - if (arg->IsHeapObject() && arg->GetClassId() == kClosureCid) { - closure = Closure::RawCast(arg); - if (closure.function() == function.ptr()) { - return closure.ptr(); - } + // :async_op(result_or_exception, stack) + // so the "this" closure is the 3rd argument. + ObjectPtr arg = last_object_in_caller[2]; + if (arg->IsHeapObject() && arg->GetClassId() == kClosureCid) { + auto& closure = Closure::Handle(); + closure = Closure::RawCast(arg); + if (closure.function() == function.ptr()) { + return closure.ptr(); } } - UNREACHABLE(); + ASSERT(arg == Symbols::OptimizedOut().ptr()); + return Closure::null(); } ClosurePtr StackTraceUtils::ClosureFromFrameFunction( @@ -395,13 +421,10 @@ ClosurePtr StackTraceUtils::ClosureFromFrameFunction( if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) { // Next, look up caller's closure on the stack and walk backwards // through the yields. - // - // Due the async/async* closures having optional parameters, the - // caller-frame's pushed arguments includes the closure and should never be - // modified (even in the event of deopts). ObjectPtr* last_caller_obj = reinterpret_cast(frame->GetCallerSp()); closure = FindClosureInFrame(last_caller_obj, function); + if (closure.IsNull()) return Closure::null(); // If this async function hasn't yielded yet, we're still dealing with a // normal stack. Continue to next frame as usual. @@ -589,13 +612,11 @@ intptr_t StackTraceUtils::CountFrames(Thread* thread, function.parent_function() != Function::null()) { if (async_function.ptr() == function.parent_function()) { if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) { - // Due the async/async* closures having optional parameters, the - // caller-frame's pushed arguments includes the closure and should - // never be modified (even in the event of deopts). ObjectPtr* last_caller_obj = reinterpret_cast(frame->GetCallerSp()); closure = FindClosureInFrame(last_caller_obj, function); - if (CallerClosureFinder::IsRunningAsync(closure)) { + if (!closure.IsNull() && + CallerClosureFinder::IsRunningAsync(closure)) { *sync_async_end = false; return frame_count; } diff --git a/runtime/vm/stack_trace.h b/runtime/vm/stack_trace.h index c2eb02abc24..6893a7fa8bb 100644 --- a/runtime/vm/stack_trace.h +++ b/runtime/vm/stack_trace.h @@ -56,6 +56,11 @@ class CallerClosureFinder { static bool IsRunningAsync(const Closure& receiver_closure); private: + ClosurePtr FindCallerInternal(const Closure& receiver_closure); + ClosurePtr GetCallerInFutureListenerInternal(const Object& future_listener); + ClosurePtr UnwrapAsyncThen(const Closure& closure); + + Closure& closure_; Context& receiver_context_; Function& receiver_function_; Function& parent_function_; @@ -77,6 +82,7 @@ class CallerClosureFinder { Class& controller_subscription_class; Class& buffering_stream_subscription_class; Class& stream_iterator_class; + Function& async_then_wrapper_; Field& future_result_or_listeners_field; Field& callback_field; diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h index 43d9b2057a8..707df3dfbd9 100644 --- a/runtime/vm/symbols.h +++ b/runtime/vm/symbols.h @@ -31,6 +31,7 @@ class ObjectPointerVisitor; V(AsyncStarMoveNextHelper, "_asyncStarMoveNextHelper") \ V(AwaitContextVar, ":await_ctx_var") \ V(AwaitJumpVar, ":await_jump_var") \ + V(AsyncThenWrapperHelper, "_asyncThenWrapperHelper") \ V(Bool, "bool") \ V(BooleanExpression, "boolean expression") \ V(BoundsCheckForPartialInstantiation, "_boundsCheckForPartialInstantiation") \ @@ -102,7 +103,6 @@ class ObjectPointerVisitor; V(EvalSourceUri, "evaluate:source") \ V(EvaluateAssertion, "_evaluateAssertion") \ V(ExceptionHandlers, "ExceptionHandlers") \ - V(ExceptionParameter, ":exception") \ V(ExceptionVar, ":exception_var") \ V(Expando, "Expando") \ V(ExprTemp, ":expr_temp") \ diff --git a/sdk/lib/_internal/vm/lib/async_patch.dart b/sdk/lib/_internal/vm/lib/async_patch.dart index 0e4dcd148b1..2e322f19323 100644 --- a/sdk/lib/_internal/vm/lib/async_patch.dart +++ b/sdk/lib/_internal/vm/lib/async_patch.dart @@ -20,8 +20,12 @@ external _fatal(msg); // We need to pass the value as first argument and leave the second and third // arguments empty (used for error handling). +@pragma("vm:recognized", "other") dynamic Function(dynamic) _asyncThenWrapperHelper( - dynamic Function(dynamic) continuation) { + dynamic Function(dynamic, dynamic) continuation) { + @pragma("vm:invisible") + dynamic thenWrapper(dynamic arg) => continuation(arg, /*stack_trace=*/ null); + // Any function that is used as an asynchronous callback must be registered // in the current Zone. Normally, this is done by the future when a // callback is registered (for example with `.then` or `.catchError`). In our @@ -41,17 +45,15 @@ dynamic Function(dynamic) _asyncThenWrapperHelper( if (identical(currentZone, _rootZone) || identical(currentZone._registerUnaryCallback, _rootZone._registerUnaryCallback)) { - return continuation; + return thenWrapper; } - return currentZone.registerUnaryCallback(continuation); + return currentZone.registerUnaryCallback(thenWrapper); } // We need to pass the exception and stack trace objects as second and third // parameter to the continuation. dynamic Function(Object, StackTrace) _asyncErrorWrapperHelper( - dynamic Function(dynamic, dynamic, StackTrace) continuation) { - // See comments of `_asyncThenWrapperHelper`. - dynamic errorCallback(Object e, StackTrace s) => continuation(null, e, s); + dynamic Function(dynamic, StackTrace) errorCallback) { final currentZone = Zone._current; if (identical(currentZone, _rootZone) || identical(currentZone._registerBinaryCallback, @@ -68,7 +70,7 @@ dynamic Function(Object, StackTrace) _asyncErrorWrapperHelper( /// /// Returns the result of registering with `.then`. Future _awaitHelper(var object, dynamic Function(dynamic) thenCallback, - dynamic Function(dynamic, StackTrace) errorCallback, Function awaiter) { + dynamic Function(dynamic, StackTrace) errorCallback) { late _Future future; if (object is _Future) { future = object; @@ -126,7 +128,7 @@ class _AsyncStarStreamController { void runBody() { isScheduled = false; isSuspendedAtYield = false; - asyncStarBody(); + asyncStarBody(null, null); } void scheduleGenerator() { diff --git a/tests/language_2/async/await_test.dart b/tests/language_2/async/await_test.dart index 6b6443d6a83..f8b79d224c1 100644 --- a/tests/language_2/async/await_test.dart +++ b/tests/language_2/async/await_test.dart @@ -2261,15 +2261,15 @@ class FakeErrorFuture implements Future { Future then(callback(value), {Function onError}) { if (onError != null) { if (onError is OnErrorCallback2) { - return new Future.microtask(() => onError(_error, null)); + return new Future.microtask(() => onError(_error, StackTrace.empty)); } else if (onError is OnErrorCallback1) { return new Future.microtask(() => onError(_error)); } else { throw new ArgumentError.value( - onError, - "onError", - "Error handler must accept one Object or one Object and a StackTrace" - " as arguments, and return a valid result"); + onError, + "onError", + "Error handler must accept one Object or one Object and a StackTrace" + " as arguments, and return a valid result"); } } return new Future.error(_error);