| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:7:8: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| // String returnImplicit() /*error*/ { |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| // return null; // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| // return null; // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:16:8: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| // String returnMixed(bool b) /*error*/ { |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:27:15: Error: A non-null value must be returned since the return type 'int' doesn't allow null. |
| // FutureOr<int> returnAsync3() async {} // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:54:6: Error: A non-null value must be returned since the return type 'Enum' doesn't allow null. |
| // - 'Enum' is from 'pkg/front_end/testcases/nnbd/return_null.dart'. |
| // Enum caseReturn2(Enum e) /* error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:63:3: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| // String returnImplicit() /* error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| // return null; // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| // return null; // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:72:3: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| // String returnMixed(bool b) /* error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:83:3: Error: A non-null value must be returned since the return type 'int' doesn't allow null. |
| // FutureOr<int> returnAsync3() async {} // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/return_null.dart:108:3: Error: A non-null value must be returned since the return type 'Enum' doesn't allow null. |
| // - 'Enum' is from 'pkg/front_end/testcases/nnbd/return_null.dart'. |
| // Enum caseReturn2(Enum e) /* error */ { |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "dart:async" as asy; |
| |
| import "dart:async"; |
| |
| class Enum extends core::Object /*isEnum*/ { |
| final field core::int index; |
| final field core::String _name; |
| static const field core::List<self::Enum> values = #C7; |
| static const field self::Enum a = #C3; |
| static const field self::Enum b = #C6; |
| const constructor •(core::int index, core::String _name) → self::Enum |
| : self::Enum::index = index, self::Enum::_name = _name, super core::Object::•() |
| ; |
| method toString() → core::String |
| return this.{self::Enum::_name}{core::String}; |
| } |
| static method returnImplicit() → core::String { |
| core::print("foo"); |
| return let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:7:8: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| String returnImplicit() /*error*/ { |
| ^" in null; |
| } |
| static method returnExplicit() → core::String { |
| core::print("foo"); |
| return let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:13:10: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| return null; // error |
| ^" in let Null #t3 = null in #t3.==(null) ?{core::String} #t3 as{TypeError,ForNonNullableByDefault} core::String : #t3{core::String}; |
| } |
| static method returnMixed(core::bool b) → core::String { |
| if(b) { |
| core::print("foo"); |
| return let final Never #t4 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:19:12: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| return null; // error |
| ^" in let Null #t5 = null in #t5.==(null) ?{core::String} #t5 as{TypeError,ForNonNullableByDefault} core::String : #t5{core::String}; |
| } |
| return let final Never #t6 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:16:8: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| String returnMixed(bool b) /*error*/ { |
| ^" in null; |
| } |
| static method returnAsync1() → asy::Future<dynamic> /* originally async */ { |
| final asy::_Future<dynamic> :async_future = new asy::_Future::•<dynamic>(); |
| core::bool* :is_sync = false; |
| FutureOr<dynamic>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L1: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| static method returnAsync2() → FutureOr<dynamic> /* originally async */ { |
| final asy::_Future<dynamic> :async_future = new asy::_Future::•<dynamic>(); |
| core::bool* :is_sync = false; |
| FutureOr<dynamic>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L2: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| static method returnAsync3() → FutureOr<core::int> /* originally async */ { |
| final asy::_Future<core::int> :async_future = new asy::_Future::•<core::int>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L3: |
| { |
| :return_value = let final Never #t7 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:27:15: Error: A non-null value must be returned since the return type 'int' doesn't allow null. |
| FutureOr<int> returnAsync3() async {} // error |
| ^" in null; |
| break #L3; |
| } |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| static method returnAsync4() → FutureOr<core::int?> /* originally async */ { |
| final asy::_Future<core::int?> :async_future = new asy::_Future::•<core::int?>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int?>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L4: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| static method returnAsync5() → dynamic /* originally async */ { |
| final asy::_Future<dynamic> :async_future = new asy::_Future::•<dynamic>(); |
| core::bool* :is_sync = false; |
| FutureOr<dynamic>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L5: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| static method returnAsync6() → asy::Future<core::int?> /* originally async */ { |
| final asy::_Future<core::int?> :async_future = new asy::_Future::•<core::int?>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int?>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L6: |
| { |
| :return_value = null; |
| break #L6; |
| } |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| static method returnAsync7() → asy::Future<core::int?> /* originally async */ { |
| final asy::_Future<core::int?> :async_future = new asy::_Future::•<core::int?>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int?>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L7: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| static method yieldSync() → core::Iterable<dynamic> /* originally sync* */ { |
| function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* { |
| core::int :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding { |
| {} |
| return false; |
| } |
| return :sync_op; |
| } |
| return new core::_SyncIterable::•<dynamic>(:sync_op_gen); |
| } |
| static method yieldAsync() → asy::Stream<dynamic> /* originally async* */ { |
| asy::_AsyncStarStreamController<dynamic>? :controller; |
| dynamic :controller_stream; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try |
| try { |
| #L8: |
| {} |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| :controller.{asy::_AsyncStarStreamController::addError}(exception, stack_trace); |
| } |
| finally { |
| :controller.{asy::_AsyncStarStreamController::close}(); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :controller = new asy::_AsyncStarStreamController::•<dynamic>(:async_op); |
| :controller_stream = :controller.{asy::_AsyncStarStreamController::stream}; |
| return :controller_stream; |
| } |
| static method caseReturn1(self::Enum e) → self::Enum { |
| switch(e) { |
| #L9: |
| case #C3: |
| { |
| return e; |
| } |
| #L10: |
| case #C6: |
| { |
| return e; |
| } |
| } |
| } |
| static method caseReturn2(self::Enum e) → self::Enum { |
| switch(e) { |
| #L11: |
| case #C3: |
| { |
| return e; |
| } |
| #L12: |
| default: |
| {} |
| } |
| return let final Never #t8 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:54:6: Error: A non-null value must be returned since the return type 'Enum' doesn't allow null. |
| - 'Enum' is from 'pkg/front_end/testcases/nnbd/return_null.dart'. |
| Enum caseReturn2(Enum e) /* error */ { |
| ^" in null; |
| } |
| static method localFunctions() → dynamic { |
| function returnImplicit() → core::String { |
| core::print("foo"); |
| return let final Never #t9 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:63:3: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| String returnImplicit() /* error */ { |
| ^" in null; |
| } |
| function returnExplicit() → core::String { |
| core::print("foo"); |
| return let final Never #t10 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:69:12: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| return null; // error |
| ^" in let Null #t11 = null in #t11.==(null) ?{core::String} #t11 as{TypeError,ForNonNullableByDefault} core::String : #t11{core::String}; |
| } |
| function returnMixed(core::bool b) → core::String { |
| if(b) { |
| core::print("foo"); |
| return let final Never #t12 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:75:14: Error: The value 'null' can't be returned from a function with return type 'String' because 'String' is not nullable. |
| return null; // error |
| ^" in let Null #t13 = null in #t13.==(null) ?{core::String} #t13 as{TypeError,ForNonNullableByDefault} core::String : #t13{core::String}; |
| } |
| return let final Never #t14 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:72:3: Error: A non-null value must be returned since the return type 'String' doesn't allow null. |
| String returnMixed(bool b) /* error */ { |
| ^" in null; |
| } |
| function returnAsync1() → asy::Future<dynamic> /* originally async */ { |
| final asy::_Future<dynamic> :async_future = new asy::_Future::•<dynamic>(); |
| core::bool* :is_sync = false; |
| FutureOr<dynamic>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L13: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| function returnAsync2() → FutureOr<dynamic> /* originally async */ { |
| final asy::_Future<dynamic> :async_future = new asy::_Future::•<dynamic>(); |
| core::bool* :is_sync = false; |
| FutureOr<dynamic>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L14: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| function returnAsync3() → FutureOr<core::int> /* originally async */ { |
| final asy::_Future<core::int> :async_future = new asy::_Future::•<core::int>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L15: |
| { |
| :return_value = let final Never #t15 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:83:3: Error: A non-null value must be returned since the return type 'int' doesn't allow null. |
| FutureOr<int> returnAsync3() async {} // error |
| ^" in null; |
| break #L15; |
| } |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| function returnAsync4() → FutureOr<core::int?> /* originally async */ { |
| final asy::_Future<core::int?> :async_future = new asy::_Future::•<core::int?>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int?>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L16: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| function returnAsync5() → asy::Future<Null> /* originally async */ { |
| final asy::_Future<Null> :async_future = new asy::_Future::•<Null>(); |
| core::bool* :is_sync = false; |
| FutureOr<Null>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L17: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| function returnAsync6() → asy::Future<core::int?> /* originally async */ { |
| final asy::_Future<core::int?> :async_future = new asy::_Future::•<core::int?>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int?>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L18: |
| { |
| :return_value = null; |
| break #L18; |
| } |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| function returnAsync7() → asy::Future<core::int?> /* originally async */ { |
| final asy::_Future<core::int?> :async_future = new asy::_Future::•<core::int?>(); |
| core::bool* :is_sync = false; |
| FutureOr<core::int?>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try { |
| #L19: |
| {} |
| asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op.call(); |
| :is_sync = true; |
| return :async_future; |
| } |
| function yieldSync() → core::Iterable<dynamic> /* originally sync* */ { |
| function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* { |
| core::int :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding { |
| {} |
| return false; |
| } |
| return :sync_op; |
| } |
| return new core::_SyncIterable::•<dynamic>(:sync_op_gen); |
| } |
| function yieldAsync() → asy::Stream<dynamic> /* originally async* */ { |
| asy::_AsyncStarStreamController<dynamic>? :controller; |
| dynamic :controller_stream; |
| (dynamic) → dynamic :async_op_then; |
| (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 |
| try |
| try { |
| #L20: |
| {} |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| :controller.{asy::_AsyncStarStreamController::addError}(exception, stack_trace); |
| } |
| finally { |
| :controller.{asy::_AsyncStarStreamController::close}(); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :controller = new asy::_AsyncStarStreamController::•<dynamic>(:async_op); |
| :controller_stream = :controller.{asy::_AsyncStarStreamController::stream}; |
| return :controller_stream; |
| } |
| function caseReturn1(self::Enum e) → self::Enum { |
| switch(e) { |
| #L21: |
| case #C3: |
| { |
| return e; |
| } |
| #L22: |
| case #C6: |
| { |
| return e; |
| } |
| } |
| } |
| function caseReturn2(self::Enum e) → self::Enum { |
| switch(e) { |
| #L23: |
| case #C3: |
| { |
| return e; |
| } |
| #L24: |
| default: |
| {} |
| } |
| return let final Never #t16 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:108:3: Error: A non-null value must be returned since the return type 'Enum' doesn't allow null. |
| - 'Enum' is from 'pkg/front_end/testcases/nnbd/return_null.dart'. |
| Enum caseReturn2(Enum e) /* error */ { |
| ^" in null; |
| } |
| core::bool b = false; |
| core::int? local1 = (() → core::int? { |
| if(b) |
| return 0; |
| })(){() → core::int?}; |
| core::int? local2 = (() → core::int? { |
| if(b) |
| return null; |
| if(!b) |
| return 0; |
| })(){() → core::int?}; |
| } |
| static method main() → dynamic {} |
| |
| constants { |
| #C1 = 0 |
| #C2 = "Enum.a" |
| #C3 = self::Enum {index:#C1, _name:#C2} |
| #C4 = 1 |
| #C5 = "Enum.b" |
| #C6 = self::Enum {index:#C4, _name:#C5} |
| #C7 = <self::Enum>[#C3, #C6] |
| } |
| |
| Extra constant evaluation status: |
| Evaluated: MethodInvocation @ org-dartlang-testcase:///return_null.dart:13:10 -> BoolConstant(true) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:13:10 -> NullConstant(null) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:13:10 -> NullConstant(null) |
| Evaluated: MethodInvocation @ org-dartlang-testcase:///return_null.dart:19:12 -> BoolConstant(true) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:19:12 -> NullConstant(null) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:19:12 -> NullConstant(null) |
| Evaluated: MethodInvocation @ org-dartlang-testcase:///return_null.dart:69:12 -> BoolConstant(true) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:69:12 -> NullConstant(null) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:69:12 -> NullConstant(null) |
| Evaluated: MethodInvocation @ org-dartlang-testcase:///return_null.dart:75:14 -> BoolConstant(true) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:75:14 -> NullConstant(null) |
| Evaluated: VariableGet @ org-dartlang-testcase:///return_null.dart:75:14 -> NullConstant(null) |
| Extra constant evaluation: evaluated: 394, effectively constant: 12 |
| |
| |
| Constructor coverage from constants: |
| org-dartlang-testcase:///return_null.dart: |
| - Enum. (from org-dartlang-testcase:///return_null.dart:43:6) |
| - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9) |