blob: 3643cf7598a85c1e0021ef5d968b8dd78ebace3d [file] [log] [blame]
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:_internal" as _in;
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};
}
static method returnImplicit() → core::String {
core::print("foo");
return let final<BottomType> #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<BottomType> #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 null;
}
static method returnMixed(core::bool b) → core::String {
if(b) {
core::print("foo");
return let final<BottomType> #t3 = 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 null;
}
return let final<BottomType> #t4 = 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<BottomType> #t5 = 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;
}
#L11:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable enum type.");
}
}
static method caseReturn2(self::Enum e) → self::Enum {
switch(e) {
#L12:
case #C3:
{
return e;
}
#L13:
default:
{}
}
return let final<BottomType> #t6 = 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<BottomType> #t7 = 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<BottomType> #t8 = 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 null;
}
function returnMixed(core::bool b) → core::String {
if(b) {
core::print("foo");
return let final<BottomType> #t9 = 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 null;
}
return let final<BottomType> #t10 = 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 {
#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 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 {
#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 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 {
#L16:
{
:return_value = let final<BottomType> #t11 = 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 #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 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 {
#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 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 {
#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 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 {
#L19:
{
:return_value = null;
break #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 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 {
#L20:
{}
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 {
#L21:
{}
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) {
#L22:
case #C3:
{
return e;
}
#L23:
case #C6:
{
return e;
}
#L24:
default:
throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable enum type.");
}
}
function caseReturn2(self::Enum e) → self::Enum {
switch(e) {
#L25:
case #C3:
{
return e;
}
#L26:
default:
{}
}
return let final<BottomType> #t12 = 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;
}).call();
core::int? local2 = (() → core::int? {
if(b)
return null;
if(!b)
return 0;
}).call();
}
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]
}
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)