blob: 74a0b64846a35112d078d639a3cf76d93f004736 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue43716a.dart:15:14: Error: A value of type 'Object?' can't be returned from a function with return type 'Object' because 'Object?' is nullable and 'Object' isn't.
// - 'Object' is from 'dart:core'.
// return z.x; // Error.
// ^
//
import self as self;
import "dart:core" as core;
class C<X extends self::C<self::C::X%, self::C::X%>? = self::C<dynamic, dynamic>?, Y extends self::C<self::C::Y%, self::C::Y%>? = self::C<dynamic, dynamic>?> extends core::Object {
covariant-by-class field self::C::X% x;
constructor •(self::C::X% x) self::C<self::C::X%, self::C::Y%>
: self::C::x = x, super core::Object::•()
;
method m(covariant-by-class self::C::X% x, covariant-by-class self::C::Y% y) core::Object {
self::C<core::Object?, core::Object?>? z = self::b ?{self::C<core::Object?, core::Object?>?} x : y;
if(z == null)
throw 0;
return invalid-expression "pkg/front_end/testcases/nnbd/issue43716a.dart:15:14: Error: A value of type 'Object?' can't be returned from a function with return type 'Object' because 'Object?' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
return z.x; // Error.
^" in let core::Object? #t1 = z{self::C<core::Object?, core::Object?>}.{self::C::x}{core::Object?} in #t1 == null ?{core::Object} #t1 as{TypeError,ForNonNullableByDefault} core::Object : #t1{core::Object};
}
}
static field core::bool b = true;
static method main() dynamic {}