fdc765faad
TEST=existing Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
46 lines
1.7 KiB
Plaintext
46 lines
1.7 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart:8:5: Error: Field 'x' should be initialized because its type 'int' doesn't allow null.
|
|
// int x; // Error.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart:13:14: Error: Field 'x' should be initialized because its type 'int' doesn't allow null.
|
|
// static int x; // Error.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart:17:7: Error: Field 'lx' should be initialized because its type 'int' doesn't allow null.
|
|
// int lx; // Error.
|
|
// ^^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart:23:5: Error: Field 'lt' should be initialized because its type 'T' doesn't allow null.
|
|
// T lt; // Error.
|
|
// ^^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A<T extends core::Object?> extends core::Object {
|
|
static field core::int x = null;
|
|
static field core::int? y = null;
|
|
late static field core::int z;
|
|
field core::int lx = null;
|
|
field core::int? ly = null;
|
|
late field core::int? lz;
|
|
field core::int lv;
|
|
field core::int lu;
|
|
generic-covariant-impl field self::A::T% lt = null;
|
|
generic-covariant-impl field self::A::T? ls = null;
|
|
late generic-covariant-impl field self::A::T% lr;
|
|
generic-covariant-impl field self::A::T% lp;
|
|
generic-covariant-impl field self::A::T% lq;
|
|
constructor •(core::int lv, self::A::T% lp, self::A::T% t) → self::A<self::A::T%>
|
|
: self::A::lv = lv, self::A::lp = lp, self::A::lu = 42, self::A::lq = t, super core::Object::•()
|
|
;
|
|
}
|
|
static field core::int x;
|
|
static field core::int? y;
|
|
late static field core::int z;
|
|
static method main() → dynamic {}
|