Files
sdk/pkg/front_end/testcases/nnbd/issue42844_1.dart.weak.expect
T
Johnni Winther 60702d4158 [cfe] Make field assignability immutable
Changes fields to be either mutable or immutable by construction.
This ensure that we don't create setter references for fields that
cannot be assigned to and is a prerequisite for replacing @fields/
@fields= canonical names with @getters/@setters.

TEST=existing expectation tests and verification

Change-Id: I70b9a504ee6f221b7c334ac02620feb0d5f7ae01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-28 16:11:14 +00:00

25 lines
749 B
Plaintext

library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue42844_1.dart:6:9: Error: Field 'n' should be initialized because its type 'Never' doesn't allow null.
// Never n; // Error.
// ^
//
import self as self;
import "dart:core" as core;
class C extends core::Object {
field Never n = null;
static final field dynamic _redirecting# = <dynamic>[self::C::•]/*isLegacy*/;
static factory •(Never n) → self::C
let dynamic #redirecting_factory = self::D::• in invalid-expression;
}
class D extends core::Object implements self::C {
field Never n;
constructor •(Never n) → self::D
: self::D::n = n, super core::Object::•()
;
}
static method main() → dynamic {}