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

41 lines
1.5 KiB
Plaintext

library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue43689.dart:6:17: Error: 'y' is already declared in this scope.
// late final int? y;
// ^
// pkg/front_end/testcases/nnbd/issue43689.dart:5:16: Context: Previous declaration of 'y'.
// late final int y;
// ^
//
// pkg/front_end/testcases/nnbd/issue43689.dart:10:19: Error: 'x' is already declared in this scope.
// late final int? x;
// ^
// pkg/front_end/testcases/nnbd/issue43689.dart:9:18: Context: Previous declaration of 'x'.
// late final int x;
// ^
//
// pkg/front_end/testcases/nnbd/issue43689.dart:12:8: Error: 'z' is already declared in this scope.
// int? z;
// ^
// pkg/front_end/testcases/nnbd/issue43689.dart:11:7: Context: Previous declaration of 'z'.
// int z;
// ^
//
import self as self;
import "dart:core" as core;
late static final [setter] field core::int y;
static method test() → dynamic {
late final core::int x;
late final core::int? x = invalid-expression "pkg/front_end/testcases/nnbd/issue43689.dart:10:19: Error: 'x' is already declared in this scope.
late final int? x;
^" as{TypeError,ForDynamic,ForNonNullableByDefault} core::int?;
core::int z;
core::int? z = invalid-expression "pkg/front_end/testcases/nnbd/issue43689.dart:12:8: Error: 'z' is already declared in this scope.
int? z;
^" as{TypeError,ForDynamic,ForNonNullableByDefault} core::int?;
}
static method main() → dynamic {}