c191551fac
TEST=Covered by existing tests. Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
423 lines
20 KiB
Plaintext
423 lines
20 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:39:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// String Function(int) x2 = (int v) /* error */ {
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:44:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// String Function(int) x3 = (int v) /* error */ {
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:49:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// String Function(int) x5 = (int v) /* error */ {
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:54:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// String Function(int) x6 = (int v) /* error */ {
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:59:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// Future<String> Function(int) y2 = (int v) async /* error */ {
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:64:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// Future<String> Function(int) y3 = (int v) async /* error */ {
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:69:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// Future<String> Function(int) y5 = (int v) async /* error */ {
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41156.dart:74:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
// Future<String> Function(int) y6 = (int v) async /* error */ {
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
import "dart:_internal" as _in;
|
|
import "dart:async" as asy;
|
|
|
|
static method throwing() → Never
|
|
return throw "";
|
|
static method main() → void {
|
|
(core::int) → core::String x1 = (core::int v) → Never => throw v;
|
|
(core::int) → core::String x2 = (core::int v) → Never {
|
|
throw v;
|
|
};
|
|
(core::int) → core::String x3 = (core::int v) → Never {
|
|
return throw v;
|
|
};
|
|
(core::int) → core::String x4 = (core::int v) → Never => let final Never #t1 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
(core::int) → core::String x5 = (core::int v) → Never {
|
|
let final Never #t2 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
};
|
|
(core::int) → core::String x6 = (core::int v) → Never {
|
|
return let final Never #t3 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
};
|
|
(core::int) → asy::Future<core::String> y1 = (core::int v) → asy::Future<Never> /* originally async */ {
|
|
final asy::_Future<Never> :async_future = new asy::_Future::•<Never>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<Never>? :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:
|
|
{
|
|
:return_value = throw v;
|
|
break #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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y2 = (core::int v) → asy::Future<Never> /* originally async */ {
|
|
final asy::_Future<Never> :async_future = new asy::_Future::•<Never>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<Never>? :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:
|
|
{
|
|
throw v;
|
|
}
|
|
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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y3 = (core::int v) → asy::Future<Never> /* originally async */ {
|
|
final asy::_Future<Never> :async_future = new asy::_Future::•<Never>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<Never>? :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 = throw v;
|
|
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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y4 = (core::int v) → asy::Future<Never> /* originally async */ {
|
|
final asy::_Future<Never> :async_future = new asy::_Future::•<Never>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<Never>? :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:
|
|
{
|
|
:return_value = let final Never #t4 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
break #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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y5 = (core::int v) → asy::Future<Never> /* originally async */ {
|
|
final asy::_Future<Never> :async_future = new asy::_Future::•<Never>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<Never>? :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:
|
|
{
|
|
let final Never #t5 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
}
|
|
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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y6 = (core::int v) → asy::Future<Never> /* originally async */ {
|
|
final asy::_Future<Never> :async_future = new asy::_Future::•<Never>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<Never>? :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 = let final Never #t6 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
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 errors() → void /* 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 {
|
|
#L7:
|
|
{
|
|
(core::int) → core::String x2 = (core::int v) → core::String {
|
|
try {
|
|
throw v;
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
return let final Never #t7 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:39:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
String Function(int) x2 = (int v) /* error */ {
|
|
^" in null;
|
|
};
|
|
(core::int) → core::String x3 = (core::int v) → core::String {
|
|
try {
|
|
return throw v;
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
return let final Never #t8 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:44:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
String Function(int) x3 = (int v) /* error */ {
|
|
^" in null;
|
|
};
|
|
(core::int) → core::String x5 = (core::int v) → core::String {
|
|
try {
|
|
let final Never #t9 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
return let final Never #t10 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:49:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
String Function(int) x5 = (int v) /* error */ {
|
|
^" in null;
|
|
};
|
|
(core::int) → core::String x6 = (core::int v) → core::String {
|
|
try {
|
|
return let final Never #t11 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
return let final Never #t12 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:54:29: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
String Function(int) x6 = (int v) /* error */ {
|
|
^" in null;
|
|
};
|
|
(core::int) → asy::Future<core::String> y2 = (core::int v) → asy::Future<core::String> /* originally async */ {
|
|
final asy::_Future<core::String> :async_future = new asy::_Future::•<core::String>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<core::String>? :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 {
|
|
#L8:
|
|
{
|
|
try {
|
|
throw v;
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
:return_value = let final Never #t13 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:59:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
Future<String> Function(int) y2 = (int v) async /* error */ {
|
|
^" in null;
|
|
break #L8;
|
|
}
|
|
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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y3 = (core::int v) → asy::Future<core::String> /* originally async */ {
|
|
final asy::_Future<core::String> :async_future = new asy::_Future::•<core::String>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<core::String>? :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 {
|
|
#L9:
|
|
{
|
|
try {
|
|
:return_value = throw v;
|
|
break #L9;
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
:return_value = let final Never #t14 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:64:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
Future<String> Function(int) y3 = (int v) async /* error */ {
|
|
^" in null;
|
|
break #L9;
|
|
}
|
|
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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y5 = (core::int v) → asy::Future<core::String> /* originally async */ {
|
|
final asy::_Future<core::String> :async_future = new asy::_Future::•<core::String>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<core::String>? :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 {
|
|
#L10:
|
|
{
|
|
try {
|
|
let final Never #t15 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
:return_value = let final Never #t16 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:69:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
Future<String> Function(int) y5 = (int v) async /* error */ {
|
|
^" in null;
|
|
break #L10;
|
|
}
|
|
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;
|
|
};
|
|
(core::int) → asy::Future<core::String> y6 = (core::int v) → asy::Future<core::String> /* originally async */ {
|
|
final asy::_Future<core::String> :async_future = new asy::_Future::•<core::String>();
|
|
core::bool* :is_sync = false;
|
|
FutureOr<core::String>? :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 {
|
|
#L11:
|
|
{
|
|
try {
|
|
:return_value = let final Never #t17 = self::throwing() in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
|
|
break #L11;
|
|
}
|
|
on core::Object catch(final core::Object _) {
|
|
}
|
|
:return_value = let final Never #t18 = invalid-expression "pkg/front_end/testcases/nnbd/issue41156.dart:74:37: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
|
|
Future<String> Function(int) y6 = (int v) async /* error */ {
|
|
^" in null;
|
|
break #L11;
|
|
}
|
|
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;
|
|
};
|
|
}
|
|
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;
|
|
}
|