blob: 2ed0f1639326437dccda0460ea8ee13134873d54 [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 z{self::C<core::Object?, core::Object?>}.{self::C::x}{core::Object?} as{TypeError,ForNonNullableByDefault} core::Object;
}
}
static field core::bool b = true;
static method main() dynamic {}