Update tests after rename to UNCHECKED_USE_OF_NULLABLE_VALUE.
R=brianwilkerson@google.com Change-Id: I51544b0955a906920aa80ae30aa9ecbf80294baf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144006 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
bf363c5b32
commit
eae75026fa
@@ -8,14 +8,14 @@ void main() async {
|
||||
Stream<int>? nullStream;
|
||||
var a = <int>[await for (var i in nullStream) 1];
|
||||
// ^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] The type 'Stream<int>?' used in the 'for' loop must implement 'Stream<dynamic>'.
|
||||
var b = <int, int>{await for (var i in nullStream) 1: 1};
|
||||
// ^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] The type 'Stream<int>?' used in the 'for' loop must implement 'Stream<dynamic>'.
|
||||
var c = <int>{await for (var i in nullStream) 1};
|
||||
// ^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] The type 'Stream<int>?' used in the 'for' loop must implement 'Stream<dynamic>'.
|
||||
}
|
||||
|
||||
@@ -117,14 +117,14 @@ void testNullIterable() {
|
||||
Iterable<int>? nullIterable = null;
|
||||
var a = <int>[for (var i in nullIterable) 1];
|
||||
// ^^^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>'.
|
||||
var b = {for (var i in nullIterable) 1: 1};
|
||||
// ^^^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>'.
|
||||
var c = <int>{for (var i in nullIterable) 1};
|
||||
// ^^^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>'.
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@ void main() {
|
||||
bool? nullBool = null;
|
||||
var a = <int>[for (; nullBool;) 1];
|
||||
// ^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
|
||||
var b = <int, int>{for (; nullBool;) 1: 1};
|
||||
// ^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
|
||||
var c = <int>{for (; nullBool;) 1};
|
||||
// ^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ void main() {
|
||||
bool? nullBool;
|
||||
var a = <int>[if (nullBool) 1];
|
||||
// ^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
|
||||
|
||||
var b = <int, int>{if (nullBool) 1: 1};
|
||||
// ^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
|
||||
|
||||
var c = <int>{if (nullBool) 1};
|
||||
// ^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
|
||||
}
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ void f1(NotGeneric x) {
|
||||
void f2(NotGeneric? x) {
|
||||
x?[0] + 1;
|
||||
//^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] unspecified
|
||||
x?[0] = 1;
|
||||
useNonNullable(x?[0] = 1);
|
||||
@@ -46,14 +46,14 @@ void f2(NotGeneric? x) {
|
||||
void f3<T extends num>(Generic<T>? x) {
|
||||
x?[0] + 1;
|
||||
//^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] unspecified
|
||||
}
|
||||
|
||||
void f4<T extends num>(Generic<T?> x) {
|
||||
x[0] + 1;
|
||||
//^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] unspecified
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@ void f1(
|
||||
(nullableInt ?? nonNullInt) + 1;
|
||||
(nullableInt ?? nullableInt) + 1;
|
||||
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] unspecified
|
||||
(nonNullInt ?? nullableInt) + 1;
|
||||
// ^^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
|
||||
//^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
|
||||
// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
|
||||
// [cfe] unspecified
|
||||
(nonNullInt ?? nonNullInt) + 1;
|
||||
// ^^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user