d352bc28b8
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>
23 lines
789 B
Dart
23 lines
789 B
Dart
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// 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.
|
|
|
|
// This test verifies that a block of code that results from promotion to the
|
|
// `Never` type cannot affect the "definitely unassigned" state of a late
|
|
// variable, because promotion to `Never` causes the code to be considered
|
|
// unreachable.
|
|
|
|
|
|
main() {
|
|
late int i;
|
|
Null n = null;
|
|
if (n != null) {
|
|
// n has type `Never`, so this code is unreachable.
|
|
i = 42;
|
|
}
|
|
i; // Variable is definitely unassigned
|
|
//^
|
|
// [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
|
|
// [cfe] Late variable 'i' without initializer is definitely unassigned.
|
|
}
|