Files
sdk/pkg/front_end/testcases/nnbd/issue43276.dart.strong.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

39 lines
1.3 KiB
Plaintext

library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.gen({int i}); // error
// ^
//
// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.fact({int i}) /* error */ {
// ^
//
import self as self;
import "dart:core" as core;
class C extends core::Object {
static final field dynamic _redirecting# = <dynamic>[self::C::redirect]/*isLegacy*/;
constructor gen({core::int i = #C1}) → self::C
: super core::Object::•()
;
static factory fact({core::int i = #C1}) → self::C {
return new self::C::gen();
}
static factory redirect({core::int i = #C1}) → self::C
let dynamic #redirecting_factory = self::C::gen in invalid-expression;
}
class D extends core::Object {
synthetic constructor •() → self::D
: super core::Object::•()
;
}
static method main() → dynamic {}
constants {
#C1 = null
}