mirror of
https://github.com/dart-lang/sdk
synced 2024-07-20 18:05:01 +00:00
Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it. There are still some uses in front_end/testcases that are not just removable (it also uses `no-non-nullable`). There migth be more uses that are not as easily found as grepping for `--enable-experiment Removes two VM tests where fixing them meant they were just duplicating the corresponding non *_2/ tests. Fixes #44941 TEST= Large number of tests chaged.=(no-)?non-nullable`. Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688 Commit-Queue: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>
This commit is contained in:
parent
2d27b34b06
commit
d352bc28b8
|
@ -33,7 +33,7 @@ runTests(List<String> args, [int shardIndex]) {
|
|||
shards: 2,
|
||||
directory: 'data',
|
||||
skip: skip,
|
||||
options: ['--enable-experiment=non-nullable', Flags.soundNullSafety]);
|
||||
options: [Flags.soundNullSafety]);
|
||||
}
|
||||
|
||||
runTests2(List<String> args, [int shardIndex]) {
|
||||
|
|
|
@ -219,7 +219,6 @@ class SourceToDillStep implements IOModularStep {
|
|||
.expand((m) => ['--input-linked', '${toUri(m, dillId)}'])),
|
||||
...(sources.expand((String uri) => ['--source', uri])),
|
||||
...(flags.expand((String flag) => ['--enable-experiment', flag])),
|
||||
'--enable-experiment=non-nullable',
|
||||
];
|
||||
|
||||
var result =
|
||||
|
|
|
@ -71,26 +71,6 @@ void pub() {
|
|||
expect(result.stderr, result2.stderr);
|
||||
});
|
||||
|
||||
test('run --enable-experiment', () {
|
||||
p = project();
|
||||
p.file('bin/main.dart',
|
||||
"void main() { int? a; a = null; print('a is \$a.'); }");
|
||||
|
||||
// run 'pub get'
|
||||
p.runSync(['pub', 'get']);
|
||||
|
||||
var result = p.runSync(
|
||||
['pub', 'run', '--enable-experiment=no-non-nullable', 'main.dart']);
|
||||
|
||||
expect(result.exitCode, 254);
|
||||
expect(result.stdout, isEmpty);
|
||||
expect(
|
||||
result.stderr,
|
||||
contains('bin/main.dart:1:18: Error: This requires the null safety '
|
||||
'language feature, which requires language version of 2.12 or '
|
||||
'higher.\n'));
|
||||
});
|
||||
|
||||
test('failure', () {
|
||||
p = project(mainSrc: 'int get foo => 1;\n');
|
||||
var result = p.runSync(['pub', 'deps']);
|
||||
|
|
|
@ -117,15 +117,12 @@ main() {}
|
|||
var result = Process.runSync(dart.toFilePath(), [
|
||||
// The NNBD dart binaries / snapshots require this flag to be enabled at
|
||||
// VM level.
|
||||
if (analyzerSnapshot.contains('NNBD')) '--enable-experiment=non-nullable',
|
||||
analyzerSnapshot,
|
||||
'--dart-sdk=${sdkDir}',
|
||||
'--format',
|
||||
'machine',
|
||||
'--sdk-warnings',
|
||||
'--no-hints',
|
||||
'--enable-experiment',
|
||||
'non-nullable',
|
||||
emptyProgramUri.toFilePath()
|
||||
]);
|
||||
|
||||
|
|
|
@ -788,7 +788,6 @@ class Run extends Step<ComponentResult, ComponentResult, FastaContext> {
|
|||
try {
|
||||
var args = <String>[];
|
||||
if (experimentalFlags[ExperimentalFlag.nonNullable] == true) {
|
||||
args.add("--enable-experiment=non-nullable");
|
||||
if (!context.weak) {
|
||||
args.add("--sound-null-safety");
|
||||
}
|
||||
|
|
|
@ -1761,7 +1761,6 @@ class BarState extends State<FizzWidget> {
|
|||
'--output-dill=${dillFile.path}',
|
||||
'--packages=${package_config.path}',
|
||||
'--target=dartdevc',
|
||||
'--enable-experiment=non-nullable',
|
||||
file.path,
|
||||
];
|
||||
|
||||
|
@ -1915,7 +1914,6 @@ class BarState extends State<FizzWidget> {
|
|||
'--output-dill=${dillFile.path}',
|
||||
'--target=dartdevc',
|
||||
'--packages=${package_config.path}',
|
||||
'--enable-experiment=non-nullable',
|
||||
];
|
||||
|
||||
final StreamController<List<int>> streamController =
|
||||
|
@ -1996,7 +1994,6 @@ class BarState extends State<FizzWidget> {
|
|||
'--target=dartdevc',
|
||||
'--packages=${package_config.path}',
|
||||
'--experimental-emit-debug-metadata',
|
||||
'--enable-experiment=non-nullable',
|
||||
];
|
||||
|
||||
final StreamController<List<int>> streamController =
|
||||
|
@ -2243,7 +2240,6 @@ class BarState extends State<FizzWidget> {
|
|||
'--output-dill=${dillFile.path}',
|
||||
'--target=dartdevc',
|
||||
'--packages=${package_config.path}',
|
||||
'--enable-experiment=non-nullable',
|
||||
];
|
||||
|
||||
final StreamController<List<int>> streamController =
|
||||
|
@ -2362,7 +2358,6 @@ class BarState extends State<FizzWidget> {
|
|||
'--output-dill=${dillFile.path}',
|
||||
'--target=dartdevc',
|
||||
'--packages=${package_config.path}',
|
||||
'--enable-experiment=non-nullable'
|
||||
];
|
||||
|
||||
final StreamController<List<int>> streamController =
|
||||
|
|
|
@ -496,7 +496,6 @@ gen_snapshot_action("generate_snapshot_bin") {
|
|||
isolate_snapshot_instructions,
|
||||
]
|
||||
args = [
|
||||
"--enable-experiment=non-nullable",
|
||||
"--sound-null-safety",
|
||||
"--deterministic",
|
||||
"--snapshot_kind=" + dart_core_snapshot_kind,
|
||||
|
|
|
@ -29,7 +29,6 @@ compileAndRunTest(String comment, String expectedOutput) async {
|
|||
await runGenKernelWithoutStandardOptions('BUILD DILL FILE', [
|
||||
"--platform",
|
||||
platformDill,
|
||||
'--enable-experiment=non-nullable',
|
||||
'--output=$testDillPath',
|
||||
testScriptPath,
|
||||
]);
|
||||
|
|
|
@ -22,7 +22,6 @@ runTest(String script, String output, String temp) async {
|
|||
// Do not add Platform.executableArguments into arguments to avoid passing
|
||||
// --sound-null-safety / --no-sound-null-safety arguments.
|
||||
final result = await runBinary("RUN $script", Platform.executable, [
|
||||
'--enable-experiment=non-nullable',
|
||||
'--deterministic',
|
||||
'--optimization-counter-threshold=10',
|
||||
'--packages=${Platform.packageConfig}',
|
||||
|
|
|
@ -29,7 +29,6 @@ compileAndRunTest(String comment, String expectedOutput) async {
|
|||
await runGenKernelWithoutStandardOptions('BUILD DILL FILE', [
|
||||
"--platform",
|
||||
platformDill,
|
||||
'--enable-experiment=non-nullable',
|
||||
'--output=$testDillPath',
|
||||
testScriptPath,
|
||||
]);
|
||||
|
|
|
@ -183,7 +183,6 @@ template("gen_vm_platform") {
|
|||
args += [
|
||||
"-Ddart.vm.product=$is_product_flag",
|
||||
"-Ddart.isVM=true",
|
||||
"--enable-experiment=non-nullable",
|
||||
"--nnbd-agnostic",
|
||||
]
|
||||
if (defined(invoker.exclude_source) && invoker.exclude_source) {
|
||||
|
|
|
@ -52,4 +52,4 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
|
|||
|
||||
DART2JS="package:compiler/src/dart2js.dart"
|
||||
|
||||
exec "$DART" "--packages=$DART_ROOT/.packages" --enable-experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
|
||||
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
|
||||
|
|
|
@ -55,4 +55,4 @@ if [[ $DART_VM_OPTIONS ]]; then
|
|||
EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
|
||||
fi
|
||||
|
||||
exec "$DART" --enable-experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@"
|
||||
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// variable, because promotion to `Never` causes the code to be considered
|
||||
// unreachable.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
main() {
|
||||
late int i;
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
// expression would corrupt the state of flow analysis, causing a crash when
|
||||
// trying to finish analyzing an enclosing `if` statement.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
class C {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
// read in a catch or finally block, that there is no compile-time error,
|
||||
// because the assignment might happen prior to the exception occurring.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
void tryCatch() {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// that the assignment might occur before the read, that there is no
|
||||
// compile-time error.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
// First scenario: the variable is written inside the function, and the read
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// that there is no compile-time error, because the assignment may happen in an
|
||||
// earlier iteration than the read.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
void forLoop() {
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
// compile-time error, because the variable is unassigned on all possible
|
||||
// control flow paths to the read.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
void switchBad(int value) {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// the assignment occurs somewhere in the switch, that there is no compile-time
|
||||
// error, because the assignment may happen prior to a branch to the label.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
void switchOk(int one) {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// This test verifies that if a read is performed on a getter whose type is
|
||||
// `Never?`, the resulting code block is considered reachable by flow analysis.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
Never? get neverQuestionGetter => null;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// This test verifies that if a read is performed on a getter whose type is
|
||||
// `Never`, the resulting code block is considered unreachable by flow analysis.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
Never get neverGetter => throw 'x';
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// This test verifies that if a method is invoked whose return type is `Never?`,
|
||||
// the resulting code block is considered reachable by flow analysis.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
Never? neverQuestionFunction() => null;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// This test verifies that if a method is invoked whose return type is `Never`,
|
||||
// the resulting code block is considered unreachable by flow analysis.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
Never neverFunction() => throw 'x';
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
// resulting code block is considered reachable by flow analysis. This is in
|
||||
// contrast to promotion to `Never`, which is considered unreachable.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
void promoteViaIsCheck(Object x, Object? y) {
|
||||
if (x is! int) {
|
||||
if (y is Never?) {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
// via an explicit `is` check or a comparison to `null`), the resulting code
|
||||
// block is considered unreachable by flow analysis.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
void promoteViaIsCheck(Object x, Object? y) {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// This test verifies that if a read is performed on a variable whose type is
|
||||
// `Never?`, the resulting code block is considered reachable by flow analysis.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void explicitNeverQuestionType(Object x, bool b) {
|
||||
Never? y = null;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// This test verifies that if a read is performed on a variable whose type is
|
||||
// `Never`, the resulting code block is considered unreachable by flow analysis.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
void explicitNeverType(Never Function() f, Object x, bool b1, bool b2) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Tests that language operators and constructrs requiring non-nullable values
|
||||
// will not accept an operand with a nullable static type.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
main() {}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
main() {
|
||||
A a = A()..foo?.isEven;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that the trailing "!" properly promotes the type `Null` to `Never`, by
|
||||
// verifying that it's statically ok to pass it to a function expecting a
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
bool c = false;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that `x ?? y` results in type LUB(x!, y)
|
||||
void main() {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is a compile time error for a `late` variable initializer
|
||||
// to use the `await` expression.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error if a required named parameter has a default value.
|
||||
main() {}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
import 'dart:async';
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that Object.operator==(Object o) is the signature of ==, but that we can
|
||||
// still compare nullable values to Object.
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// Can't run in strong mode since it contains a legacy library.
|
||||
// Requirements=nnbd-weak
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
import 'export_legacy_symbol_opted_out_library.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error to do what was once allowed as an "implicit
|
||||
// downcast."
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is not a compile time error for a `final` variable to not have
|
||||
// an initializer if that variable is declared as `late`.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is not a compile time error for a `final` variable to not have
|
||||
// an initializer if that variable is declared as `late`.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error if an optional parameter (named or otherwise) with
|
||||
// no default value has a potentially non-nullable type.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error if a named parameter that is part of a required
|
||||
// group is not bound to an argument at a call site.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
void main() {
|
||||
void x;
|
||||
int i;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// It is an error if a potentially non-nullable local variable which has no
|
||||
// initializer expression and is not marked `late` is used before it is
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error if an instance field with potentially non-nullable
|
||||
// type has no initializer expression and is not initialized in a constructor
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error if a static field non-nullable type has no
|
||||
// initializer expression.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error if a top level variable with non-nullable type has
|
||||
// no initializer expression.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
class C {
|
||||
call() {}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error to use a nullable type as a supertype.
|
||||
import 'package:expect/expect.dart';
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error for a class to extend, implement, or mixin the type
|
||||
// Never.
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that `super == x` is allowed when `x` has a nullable type, even if the
|
||||
// targeted definition of `operator==` has a parameter with a non-nullable type,
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that `super == x` is properly type checked against the target
|
||||
// `operator==` method. That is, the special allowance in the following spec
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
void main() {
|
||||
final c = C();
|
||||
Expect.identical(c, c);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error if the static type of `e` in the expression
|
||||
// `throw e` is not assignable to `Object`.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error to use nullable types in unsound ways.
|
||||
void main() {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that it is an error to use nullable types in unsound ways.
|
||||
void main() async {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
void main() {
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
class A {
|
||||
static late x1;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
class A {
|
||||
static late final x2;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
int initCalls = 0;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
class A {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Invalid uses of "late" modifier
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
// VMOptions=--optimization_counter_threshold=10
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
// VMOptions=--optimization_counter_threshold=10
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
int initCalls = 0;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
// VMOptions=--optimization_counter_threshold=10
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
// VMOptions=--optimization_counter_threshold=10
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
int initCalls = 0;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
int initCalls = 0;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
late final int d = d_init();
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Test that the trailing "!" is accepted after a sampling of expression
|
||||
// syntaxes. Verify that the compiler understands the resulting type to be
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
import 'dart:async';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
class C {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'dart:core';
|
||||
import 'dart:core' as core;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
// @dart = 2.2
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
// Invalid uses of "required" modifier
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
int f({required int i}) => i + 1;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// inference. This test makes sure that the type argument information is
|
||||
// appropriately preserved.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(List<int>? x) {
|
||||
if (x == null) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(Object x) {
|
||||
if (x is String) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(bool b, Object x) {
|
||||
b ? ((x is String) || (throw 1)) : ((x is String) || (throw 2));
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(Object x) {
|
||||
do {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(Object x) {
|
||||
do {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(bool b, Object x) {
|
||||
if (x is String) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(bool b, Object x) {
|
||||
if (x is String) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f() {
|
||||
void g(Object x) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f() {
|
||||
void g(Object x) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(Object x) {
|
||||
late void Function() g;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(Object x) {
|
||||
if (x is! String) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(Object x) {
|
||||
if (x is String) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// SharedOptions=--enable-experiment=non-nullable
|
||||
|
||||
void f(Object x) {
|
||||
x is String || (throw 42);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue