Format tests/language/n*.
A lot of unspecified errors got filled in this time.
Change-Id: I88e728499da1b591ee1f6de1749f35182a6c9996
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408887
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
diff --git a/tests/language/named_arguments_anywhere/all_kinds_test.dart b/tests/language/named_arguments_anywhere/all_kinds_test.dart
index 059f3e6..244bd7c 100644
--- a/tests/language/named_arguments_anywhere/all_kinds_test.dart
+++ b/tests/language/named_arguments_anywhere/all_kinds_test.dart
@@ -15,7 +15,9 @@
}
void runAndCheckEvaluationOrder(
- List<Object?> expectedArguments, void Function() functionToRun) {
+ List<Object?> expectedArguments,
+ void Function() functionToRun,
+) {
arguments.clear();
functionToRun();
Expect.listEquals(expectedArguments, arguments);
@@ -30,19 +32,19 @@
}
A.redir1()
- : this(evaluate(1), evaluate("2"), z: evaluate(false), w: evaluate(3.14));
+ : this(evaluate(1), evaluate("2"), z: evaluate(false), w: evaluate(3.14));
A.redir2()
- : this(evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
+ : this(evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
A.redir3()
- : this(z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
+ : this(z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
A.redir4()
- : this(w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
+ : this(w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
A.redir5()
- : this(evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
+ : this(evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
A.redir6() : this(evaluate(1), w: evaluate(3.14), evaluate("2"));
@@ -212,24 +214,44 @@
// InstanceGetterInvocation.
runAndCheckEvaluationOrder([1, "2", false, 3.14], () {
- a.property(evaluate(1), evaluate("2"),
- z: evaluate(false), w: evaluate(3.14));
+ a.property(
+ evaluate(1),
+ evaluate("2"),
+ z: evaluate(false),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([1, false, "2", 3.14], () {
a.property(
- evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
+ evaluate(1),
+ z: evaluate(false),
+ evaluate("2"),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([false, 1, "2", 3.14], () {
a.property(
- z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
+ z: evaluate(false),
+ evaluate(1),
+ evaluate("2"),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([3.14, 1, "2", false], () {
a.property(
- w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
+ w: evaluate(3.14),
+ evaluate(1),
+ evaluate("2"),
+ z: evaluate(false),
+ );
});
runAndCheckEvaluationOrder([1, 3.14, "2", false], () {
a.property(
- evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
+ evaluate(1),
+ w: evaluate(3.14),
+ evaluate("2"),
+ z: evaluate(false),
+ );
});
runAndCheckEvaluationOrder([1, 3.14, "2"], () {
a.property(evaluate(1), w: evaluate(3.14), evaluate("2"));
@@ -237,24 +259,29 @@
// InstanceInvocation.
runAndCheckEvaluationOrder([a, 1, "2", false, 3.14], () {
- evaluate(a)
- .bar(evaluate(1), evaluate("2"), z: evaluate(false), w: evaluate(3.14));
+ evaluate(
+ a,
+ ).bar(evaluate(1), evaluate("2"), z: evaluate(false), w: evaluate(3.14));
});
runAndCheckEvaluationOrder([a, 1, false, "2", 3.14], () {
- evaluate(a)
- .bar(evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
+ evaluate(
+ a,
+ ).bar(evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
});
runAndCheckEvaluationOrder([a, false, 1, "2", 3.14], () {
- evaluate(a)
- .bar(z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
+ evaluate(
+ a,
+ ).bar(z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
});
runAndCheckEvaluationOrder([a, 3.14, 1, "2", false], () {
- evaluate(a)
- .bar(w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
+ evaluate(
+ a,
+ ).bar(w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
});
runAndCheckEvaluationOrder([a, 1, 3.14, "2", false], () {
- evaluate(a)
- .bar(evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
+ evaluate(
+ a,
+ ).bar(evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
});
runAndCheckEvaluationOrder([a, 1, 3.14, "2"], () {
evaluate(a).bar(evaluate(1), w: evaluate(3.14), evaluate("2"));
@@ -302,24 +329,44 @@
// Redirecting factory constructors.
runAndCheckEvaluationOrder([1, "2", false, 3.14], () {
- A.redirFactory(evaluate(1), evaluate("2"),
- z: evaluate(false), w: evaluate(3.14));
+ A.redirFactory(
+ evaluate(1),
+ evaluate("2"),
+ z: evaluate(false),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([1, false, "2", 3.14], () {
A.redirFactory(
- evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
+ evaluate(1),
+ z: evaluate(false),
+ evaluate("2"),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([false, 1, "2", 3.14], () {
A.redirFactory(
- z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
+ z: evaluate(false),
+ evaluate(1),
+ evaluate("2"),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([3.14, 1, "2", false], () {
A.redirFactory(
- w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
+ w: evaluate(3.14),
+ evaluate(1),
+ evaluate("2"),
+ z: evaluate(false),
+ );
});
runAndCheckEvaluationOrder([1, 3.14, "2", false], () {
A.redirFactory(
- evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
+ evaluate(1),
+ w: evaluate(3.14),
+ evaluate("2"),
+ z: evaluate(false),
+ );
});
runAndCheckEvaluationOrder([1, 3.14, "2"], () {
A.redirFactory(evaluate(1), w: evaluate(3.14), evaluate("2"));
@@ -370,42 +417,57 @@
Test() : super(1, "2", z: false, w: 3.14);
Test.super1()
- : super(evaluate(1), evaluate("2"),
- z: evaluate(false), w: evaluate(3.14));
+ : super(evaluate(1), evaluate("2"), z: evaluate(false), w: evaluate(3.14));
Test.super2()
- : super(
- evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
+ : super(evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
Test.super3()
- : super(
- z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
+ : super(z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
Test.super4()
- : super(
- w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
+ : super(w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
Test.super5()
- : super(
- evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
+ : super(evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
Test.super6() : super(evaluate(1), w: evaluate(3.14), evaluate("2"));
test() {
runAndCheckEvaluationOrder([1, "2", false, 3.14], () {
- super.bar(evaluate(1), evaluate("2"),
- z: evaluate(false), w: evaluate(3.14));
+ super.bar(
+ evaluate(1),
+ evaluate("2"),
+ z: evaluate(false),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([1, false, "2", 3.14], () {
super.bar(
- evaluate(1), z: evaluate(false), evaluate("2"), w: evaluate(3.14));
+ evaluate(1),
+ z: evaluate(false),
+ evaluate("2"),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([false, 1, "2", 3.14], () {
super.bar(
- z: evaluate(false), evaluate(1), evaluate("2"), w: evaluate(3.14));
+ z: evaluate(false),
+ evaluate(1),
+ evaluate("2"),
+ w: evaluate(3.14),
+ );
});
runAndCheckEvaluationOrder([3.14, 1, "2", false], () {
super.bar(
- w: evaluate(3.14), evaluate(1), evaluate("2"), z: evaluate(false));
+ w: evaluate(3.14),
+ evaluate(1),
+ evaluate("2"),
+ z: evaluate(false),
+ );
});
runAndCheckEvaluationOrder([1, 3.14, "2", false], () {
super.bar(
- evaluate(1), w: evaluate(3.14), evaluate("2"), z: evaluate(false));
+ evaluate(1),
+ w: evaluate(3.14),
+ evaluate("2"),
+ z: evaluate(false),
+ );
});
runAndCheckEvaluationOrder([1, 3.14, "2"], () {
super.bar(evaluate(1), w: evaluate(3.14), evaluate("2"));
diff --git a/tests/language/named_arguments_anywhere/order_side_effects_ok_test.dart b/tests/language/named_arguments_anywhere/order_side_effects_ok_test.dart
index cc87abc..3ae0ca4 100644
--- a/tests/language/named_arguments_anywhere/order_side_effects_ok_test.dart
+++ b/tests/language/named_arguments_anywhere/order_side_effects_ok_test.dart
@@ -14,7 +14,9 @@
}
void runAndCheckForTypeArgument(
- Type expectedArgument, void Function() functionToRun) {
+ Type expectedArgument,
+ void Function() functionToRun,
+) {
argument = null;
functionToRun();
Expect.equals(expectedArgument, argument);
diff --git a/tests/language/new/create_unresolved_type_runtime_test.dart b/tests/language/new/create_unresolved_type_runtime_test.dart
index 13d07d8..b072289 100644
--- a/tests/language/new/create_unresolved_type_runtime_test.dart
+++ b/tests/language/new/create_unresolved_type_runtime_test.dart
@@ -5,6 +5,4 @@
// 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.
-main() {
-
-}
+main() {}
diff --git a/tests/language/new/expression_type_args_runtime_test.dart b/tests/language/new/expression_type_args_runtime_test.dart
index 96f8c18..18737db 100644
--- a/tests/language/new/expression_type_args_runtime_test.dart
+++ b/tests/language/new/expression_type_args_runtime_test.dart
@@ -9,17 +9,12 @@
class A<T> {
// Can't instantiate type parameter (within static or instance method).
-
-
// OK when used within instance method, but not in static method.
m3() => new A<T>();
-
}
main() {
A a = new A();
-
a.m3();
-
}
diff --git a/tests/language/new/prefix_runtime_test.dart b/tests/language/new/prefix_runtime_test.dart
deleted file mode 100644
index 1a7288b..0000000
--- a/tests/language/new/prefix_runtime_test.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-// TODO(multitest): This was automatically migrated from a multitest and may
-// contain strange or dead code.
-
-// Copyright (c) 2013, 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.
-
-import 'dart:core' as prefix;
-
-main() {
-
-}
diff --git a/tests/language/new/statement_test.dart b/tests/language/new/statement_test.dart
index 4542501..81b124e 100644
--- a/tests/language/new/statement_test.dart
+++ b/tests/language/new/statement_test.dart
@@ -11,9 +11,7 @@
static int c = -1;
static int d = -1;
- A(int x, int y)
- : a = x,
- b = y {
+ A(int x, int y) : a = x, b = y {
A.c = x;
A.d = y;
}
diff --git a/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart b/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart
index 4a0527c..efa8cb0 100644
--- a/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart
+++ b/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart
@@ -63,9 +63,9 @@
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
nil ? 3 : 4;
-// ^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
-// [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
+ // [error column 5, length 3]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
+ // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
while (nil) {}
// ^^^
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
@@ -75,13 +75,13 @@
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
nil || true;
-// ^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
-// [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
+ // [error column 5, length 3]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
+ // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
nil && true;
-// ^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
-// [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
+ // [error column 5, length 3]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
+ // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool' because 'bool' is not nullable.
true || nil;
// ^^^
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
@@ -110,9 +110,9 @@
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
object ? 3 : 4;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
-// [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
+ // [error column 5, length 6]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
+ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
while (object) {}
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
@@ -122,13 +122,13 @@
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
object || true;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
-// [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
+ // [error column 5, length 6]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
+ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
object && true;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
-// [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
+ // [error column 5, length 6]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
+ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'.
true || object;
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
@@ -157,9 +157,9 @@
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
objectOrNull ? 3 : 4;
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
-// [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
+ // [error column 5, length 12]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
+ // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
while (objectOrNull) {}
// ^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
@@ -169,13 +169,13 @@
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
objectOrNull || true;
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
-// [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
+ // [error column 5, length 12]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
+ // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
objectOrNull && true;
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
-// [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
+ // [error column 5, length 12]
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
+ // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'.
true || objectOrNull;
// ^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
diff --git a/tests/language/nnbd/boolean_conversion/boolean_conversion_lib1.dart b/tests/language/nnbd/boolean_conversion/boolean_conversion_lib1.dart
index 9116dbb..7c20b74 100644
--- a/tests/language/nnbd/boolean_conversion/boolean_conversion_lib1.dart
+++ b/tests/language/nnbd/boolean_conversion/boolean_conversion_lib1.dart
@@ -21,8 +21,11 @@
final int constructsTested = 11;
-void check<T>(void Function(T, int) test, T value,
- void Function(void Function()) expectation) {
+void check<T>(
+ void Function(T, int) test,
+ T value,
+ void Function(void Function()) expectation,
+) {
for (int i = 0; i < constructsTested; i++) {
expectation(() => test(value, i));
}
diff --git a/tests/language/nnbd/const/potentially_constant_types_error_test.dart b/tests/language/nnbd/const/potentially_constant_types_error_test.dart
index 0242836..b0adce3 100644
--- a/tests/language/nnbd/const/potentially_constant_types_error_test.dart
+++ b/tests/language/nnbd/const/potentially_constant_types_error_test.dart
@@ -23,23 +23,23 @@
void main() {
const c1 = C1<int>.test("hello");
- // ^
- // [analyzer] unspecified
+ // ^^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
// [cfe] Constant evaluation error:
const c2 = C1<int>.test(null);
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
+ // [cfe] Constant evaluation error:
const c3 = C2<int>.test(<num>[0]);
- // ^
- // [analyzer] unspecified
+ // ^^^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
// [cfe] Constant evaluation error:
const c4 = C2<int>.test("hello");
- // ^
- // [analyzer] unspecified
+ // ^^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
// [cfe] Constant evaluation error:
const c5 = C2<int>.test(null);
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
+ // [cfe] Constant evaluation error:
}
diff --git a/tests/language/nnbd/const/potentially_constant_types_test.dart b/tests/language/nnbd/const/potentially_constant_types_test.dart
index 7e45aeb..d940b8a 100644
--- a/tests/language/nnbd/const/potentially_constant_types_test.dart
+++ b/tests/language/nnbd/const/potentially_constant_types_test.dart
@@ -17,31 +17,27 @@
/// Check instance tests in isolation
const C.test1(dynamic x)
- : isT = x is T,
- isListT = x is List<T>,
- t = null,
- l = null;
+ : isT = x is T,
+ isListT = x is List<T>,
+ t = null,
+ l = null;
/// Check casts to T in isolation
- const C.test2(dynamic x)
- : isT = true,
- isListT = false,
- t = x as T,
- l = null;
+ const C.test2(dynamic x) : isT = true, isListT = false, t = x as T, l = null;
/// Check casts to List<T> in isolation
const C.test3(dynamic x)
- : isT = false,
- isListT = true,
- t = null,
- l = x as List<T>;
+ : isT = false,
+ isListT = true,
+ t = null,
+ l = x as List<T>;
/// Combine instance checks with casts, conditional expressions, promotion
const C.test4(dynamic x)
- : isT = x is T,
- isListT = x is List<T>,
- t = (x is T) ? x : null,
- l = (x is List<T>) ? x : null;
+ : isT = x is T,
+ isListT = x is List<T>,
+ t = (x is T) ? x : null,
+ l = (x is List<T>) ? x : null;
}
void main() {
diff --git a/tests/language/nnbd/definite_assignment/definite_assignment_error_test.dart b/tests/language/nnbd/definite_assignment/definite_assignment_error_test.dart
index 6e856be..2af9908 100644
--- a/tests/language/nnbd/definite_assignment/definite_assignment_error_test.dart
+++ b/tests/language/nnbd/definite_assignment/definite_assignment_error_test.dart
@@ -117,13 +117,13 @@
final int? x;
late int? y;
x ??= 3;
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
y ??= 3;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
-// [cfe] Late variable 'y' without initializer is definitely unassigned.
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
+ // [cfe] Late variable 'y' without initializer is definitely unassigned.
}
// A while loop which does no assignments does not change unassignment state.
@@ -308,12 +308,12 @@
if (b) {
int x;
late int y;
- for (;; x) {}
- // ^
+ for (; ; x) {}
+ // ^
// [analyzer] COMPILE_TIME_ERROR.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE
// [cfe] Non-nullable variable 'x' must be assigned before it can be used.
- for (;; y) {}
- // ^
+ for (; ; y) {}
+ // ^
// [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'y' without initializer is definitely unassigned.
}
@@ -323,12 +323,12 @@
if (b) {
int x;
late int y;
- [for (;; x) 0];
- // ^
+ [for (; ; x) 0];
+ // ^
// [analyzer] COMPILE_TIME_ERROR.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE
// [cfe] Non-nullable variable 'x' must be assigned before it can be used.
- [for (;; y) 0];
- // ^
+ [for (; ; y) 0];
+ // ^
// [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'y' without initializer is definitely unassigned.
}
@@ -723,9 +723,9 @@
late int z3 = (x = 3) + (y = 3);
late int z0 = x;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE
+ // [cfe] Non-nullable variable 'x' must be assigned before it can be used.
late int z1 = y;
}
@@ -737,9 +737,9 @@
late int z0 = x = 3;
late int z1 = y = 3;
use(x);
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE
+ // [cfe] Non-nullable variable 'x' must be assigned before it can be used.
use(y);
}
@@ -1003,7 +1003,7 @@
// assigned.
if (b) {
int x;
- for (;; x) {
+ for (; ; x) {
x = 0;
}
}
@@ -1012,7 +1012,7 @@
// definitely assigned.
if (b) {
int x;
- [for (;; x) x = 0];
+ [for (; ; x) x = 0];
}
}
diff --git a/tests/language/nnbd/definite_assignment/read_error_test.dart b/tests/language/nnbd/definite_assignment/read_error_test.dart
index aae4545..159be70 100644
--- a/tests/language/nnbd/definite_assignment/read_error_test.dart
+++ b/tests/language/nnbd/definite_assignment/read_error_test.dart
@@ -32,9 +32,8 @@
{
final x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -42,9 +41,8 @@
{
int x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE
// [cfe] Non-nullable variable 'x' must be assigned before it can be used.
}
@@ -58,9 +56,8 @@
{
final int x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -68,9 +65,8 @@
{
final int? x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -78,9 +74,8 @@
{
final T x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -88,9 +83,8 @@
{
late var x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
@@ -98,9 +92,8 @@
{
late int x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
@@ -108,9 +101,8 @@
{
late int? x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
@@ -118,9 +110,8 @@
{
late T x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
@@ -128,9 +119,8 @@
{
late final x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
@@ -138,9 +128,8 @@
{
late final int x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
@@ -148,9 +137,8 @@
{
late final int? x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
@@ -158,9 +146,8 @@
{
late final T x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
// [cfe] Late variable 'x' without initializer is definitely unassigned.
}
}
@@ -190,9 +177,8 @@
x = y;
}
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -204,9 +190,8 @@
x = y;
}
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE
// [cfe] Non-nullable variable 'x' must be assigned before it can be used.
}
@@ -228,9 +213,8 @@
x = y;
}
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -242,9 +226,8 @@
x = y;
}
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -256,9 +239,8 @@
x = y;
}
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -463,216 +445,193 @@
{
final dynamic x;
x;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x(use);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x.foo;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x.foo();
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x.foo = 3;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x?.foo;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x..foo;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x[0];
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
([3])[x];
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
(x as int);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
(x is int);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
(x == null);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
(null == x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
(3 == x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
(x == 3);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
(x == 3);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x++;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
++x;
//^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
}
{
final dynamic x;
-x;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x += 3;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x ??= 3;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
x ?? 3;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
3 ?? x;
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
// [cfe] Final variable 'x' must be assigned before it can be used.
}
}
@@ -692,10 +651,9 @@
x = 3;
}
x;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -704,9 +662,8 @@
x = 3;
}
use(x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -716,10 +673,9 @@
x = 3;
}
x(use);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -728,10 +684,9 @@
x = 3;
}
x.foo;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -740,10 +695,9 @@
x = 3;
}
x.foo();
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -752,10 +706,9 @@
x = 3;
}
x.foo = 3;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -764,10 +717,9 @@
x = 3;
}
x?.foo;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -776,10 +728,9 @@
x = 3;
}
x..foo;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -788,10 +739,9 @@
x = 3;
}
x[0];
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -800,9 +750,8 @@
x = 3;
}
([3])[x];
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -812,10 +761,9 @@
x = 3;
}
(x as int);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -824,10 +772,9 @@
x = 3;
}
(x is int);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -836,10 +783,9 @@
x = 3;
}
(x == null);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -848,9 +794,8 @@
x = 3;
}
(null == x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -860,9 +805,8 @@
x = 3;
}
(3 == x);
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' must be assigned before it can be used.
}
@@ -872,10 +816,9 @@
x = 3;
}
(x == 3);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -884,10 +827,9 @@
x = 3;
}
(x == 3);
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -896,11 +838,11 @@
x = 3;
}
x++;
-// ^
-// [cfe] Final variable 'x' might already be assigned at this point.
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -910,10 +852,10 @@
}
++x;
//^
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
// [cfe] Final variable 'x' might already be assigned at this point.
// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
}
{
@@ -922,10 +864,9 @@
x = 3;
}
-x;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 6, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -934,11 +875,11 @@
x = 3;
}
x += 3;
-// ^
-// [cfe] Final variable 'x' might already be assigned at this point.
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -947,11 +888,11 @@
x = 3;
}
x ??= 3;
-// ^
-// [cfe] Final variable 'x' might already be assigned at this point.
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -960,10 +901,9 @@
x = 3;
}
x ?? 3;
-// ^
-// [cfe] Final variable 'x' must be assigned before it can be used.
- // ^
- // [analyzer] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -972,9 +912,9 @@
x = 3;
}
3 ?? x;
- // ^
- // [analyzer] unspecified
// ^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
// [cfe] Final variable 'x' must be assigned before it can be used.
}
}
@@ -1092,18 +1032,18 @@
final dynamic x;
x = 3;
x++;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
-// [cfe] Final variable 'x' might already be assigned at this point.
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
final dynamic x;
x = 3;
++x;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
-// [cfe] Final variable 'x' might already be assigned at this point.
+ //^
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
@@ -1116,18 +1056,18 @@
final dynamic x;
x = 3;
x += 3;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
-// [cfe] Final variable 'x' might already be assigned at this point.
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
final dynamic x;
x = 3;
x ??= 3;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
-// [cfe] Final variable 'x' might already be assigned at this point.
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
@@ -1140,8 +1080,8 @@
final dynamic x;
x = 3;
3 ?? x;
-// ^
-// [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
+ // ^
+ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
}
}
diff --git a/tests/language/nnbd/definite_assignment/write_error_test.dart b/tests/language/nnbd/definite_assignment/write_error_test.dart
index 1da787a..930ca48 100644
--- a/tests/language/nnbd/definite_assignment/write_error_test.dart
+++ b/tests/language/nnbd/definite_assignment/write_error_test.dart
@@ -119,9 +119,9 @@
x = y;
}
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Ok: not final.
@@ -152,9 +152,9 @@
x = y;
}
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Error: final.
@@ -165,9 +165,9 @@
x = y;
}
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Error: final.
@@ -178,9 +178,9 @@
x = y;
}
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Ok: late.
@@ -290,10 +290,9 @@
int y = 3;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
-
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Ok: not final, not late.
@@ -318,9 +317,9 @@
int y = 3;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Error: final.
@@ -329,9 +328,9 @@
int y = 3;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Error: final.
@@ -340,9 +339,9 @@
T y = t;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
// Ok: not final.
@@ -383,9 +382,9 @@
int y = 3;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.LATE_FINAL_LOCAL_ALREADY_ASSIGNED
+ // [cfe] Late final variable 'x' definitely assigned.
}
// Error: final and late.
@@ -394,10 +393,9 @@
int y = 3;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
-
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.LATE_FINAL_LOCAL_ALREADY_ASSIGNED
+ // [cfe] Late final variable 'x' definitely assigned.
}
// Error: final and late.
@@ -406,9 +404,9 @@
int y = 3;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.LATE_FINAL_LOCAL_ALREADY_ASSIGNED
+ // [cfe] Late final variable 'x' definitely assigned.
}
// Error: final and late.
@@ -417,9 +415,9 @@
T y = t;
x = y;
x = y;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.LATE_FINAL_LOCAL_ALREADY_ASSIGNED
+ // [cfe] Late final variable 'x' definitely assigned.
}
}
@@ -442,36 +440,36 @@
final dynamic x;
// Should be a read error only
x++;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
// Should be a read error only
++x;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
// Should be a read error only
x += 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
final dynamic x;
// Should be a read error only
x ??= 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
}
@@ -485,9 +483,9 @@
x = 3;
}
x = 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
@@ -496,9 +494,9 @@
x = 3;
}
use(x = 3);
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
@@ -508,9 +506,11 @@
}
// Expect both a read and write error
x++;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -520,9 +520,11 @@
}
// Expect both a read and write error
++x;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -532,9 +534,11 @@
}
// Expect both a read and write error
x += 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
{
@@ -544,9 +548,11 @@
}
// Expect both a read and write error
x ??= 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [analyzer] COMPILE_TIME_ERROR.READ_POTENTIALLY_UNASSIGNED_FINAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
+ // [cfe] Final variable 'x' must be assigned before it can be used.
}
}
@@ -558,54 +564,54 @@
final dynamic x;
x = 3;
x = 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
final dynamic x;
x = 3;
use(x = 3);
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
final dynamic x;
x = 3;
x++;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
final dynamic x;
x = 3;
++x;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
final dynamic x;
x = 3;
x += 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
{
final dynamic x;
x = 3;
x ??= 3;
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
+ // [cfe] Final variable 'x' might already be assigned at this point.
}
}
diff --git a/tests/language/nnbd/flow_analysis/issue41981_error_test.dart b/tests/language/nnbd/flow_analysis/issue41981_error_test.dart
index 905982a..fc6b066 100644
--- a/tests/language/nnbd/flow_analysis/issue41981_error_test.dart
+++ b/tests/language/nnbd/flow_analysis/issue41981_error_test.dart
@@ -7,7 +7,6 @@
// variable, because promotion to `Never` causes the code to be considered
// unreachable.
-
main() {
late int i;
Null n = null;
@@ -16,7 +15,7 @@
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.
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE
+ // [cfe] Late variable 'i' without initializer is definitely unassigned.
}
diff --git a/tests/language/nnbd/flow_analysis/local_boolean_expression_types_test.dart b/tests/language/nnbd/flow_analysis/local_boolean_expression_types_test.dart
index 311e12e..c1880c9 100644
--- a/tests/language/nnbd/flow_analysis/local_boolean_expression_types_test.dart
+++ b/tests/language/nnbd/flow_analysis/local_boolean_expression_types_test.dart
@@ -85,9 +85,11 @@
if (_alwaysTrue(null)) break;
} while (b);
x.expectStaticType<Exactly<Object>>();
- for (x.expectStaticType<Exactly<Object>>();
- b;
- x.expectStaticType<Exactly<int>>()) {
+ for (
+ x.expectStaticType<Exactly<Object>>();
+ b;
+ x.expectStaticType<Exactly<int>>()
+ ) {
x.expectStaticType<Exactly<int>>();
if (_alwaysTrue(null)) break;
}
@@ -144,9 +146,11 @@
x.expectStaticType<Exactly<int>>();
}
x.expectStaticType<Exactly<Object>>();
- for (x.expectStaticType<Exactly<Object>>();
- b;
- x.expectStaticType<Exactly<Object>>()) {
+ for (
+ x.expectStaticType<Exactly<Object>>();
+ b;
+ x.expectStaticType<Exactly<Object>>()
+ ) {
x.expectStaticType<Exactly<Object>>();
if (_alwaysTrue(null)) break;
}
@@ -203,9 +207,11 @@
x.expectStaticType<Exactly<int>>();
}
x.expectStaticType<Exactly<Object>>();
- for (x.expectStaticType<Exactly<Object>>();
- b;
- x.expectStaticType<Exactly<Object>>()) {
+ for (
+ x.expectStaticType<Exactly<Object>>();
+ b;
+ x.expectStaticType<Exactly<Object>>()
+ ) {
x.expectStaticType<Exactly<Object>>();
if (_alwaysTrue(null)) break;
}
@@ -262,9 +268,11 @@
x.expectStaticType<Exactly<int>>();
}
x.expectStaticType<Exactly<int?>>();
- for (x.expectStaticType<Exactly<int?>>();
- b;
- x.expectStaticType<Exactly<int?>>()) {
+ for (
+ x.expectStaticType<Exactly<int?>>();
+ b;
+ x.expectStaticType<Exactly<int?>>()
+ ) {
x.expectStaticType<Exactly<int?>>();
if (_alwaysTrue(null)) break;
}
@@ -317,9 +325,11 @@
if (_alwaysTrue(null)) break;
} while (b);
x.expectStaticType<Exactly<int?>>();
- for (x.expectStaticType<Exactly<int?>>();
- b;
- x.expectStaticType<Exactly<int>>()) {
+ for (
+ x.expectStaticType<Exactly<int?>>();
+ b;
+ x.expectStaticType<Exactly<int>>()
+ ) {
x.expectStaticType<Exactly<int>>();
if (_alwaysTrue(null)) break;
}
@@ -376,9 +386,11 @@
x.expectStaticType<Exactly<int>>();
}
x.expectStaticType<Exactly<int?>>();
- for (x.expectStaticType<Exactly<int?>>();
- b;
- x.expectStaticType<Exactly<int?>>()) {
+ for (
+ x.expectStaticType<Exactly<int?>>();
+ b;
+ x.expectStaticType<Exactly<int?>>()
+ ) {
x.expectStaticType<Exactly<int?>>();
if (_alwaysTrue(null)) break;
}
@@ -431,9 +443,11 @@
if (_alwaysTrue(null)) break;
} while (b);
x.expectStaticType<Exactly<int?>>();
- for (x.expectStaticType<Exactly<int?>>();
- b;
- x.expectStaticType<Exactly<int>>()) {
+ for (
+ x.expectStaticType<Exactly<int?>>();
+ b;
+ x.expectStaticType<Exactly<int>>()
+ ) {
x.expectStaticType<Exactly<int>>();
if (_alwaysTrue(null)) break;
}
@@ -458,7 +472,7 @@
if (b &&
_alwaysTrue([
x.expectStaticType<Exactly<int>>(),
- y.expectStaticType<Exactly<int>>()
+ y.expectStaticType<Exactly<int>>(),
])) {
x.expectStaticType<Exactly<int>>();
y.expectStaticType<Exactly<int>>();
@@ -468,7 +482,7 @@
}
if (_alwaysTrue([
x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
+ y.expectStaticType<Exactly<Object>>(),
]) &&
b) {
x.expectStaticType<Exactly<int>>();
@@ -480,7 +494,7 @@
if (b ||
_alwaysFalse([
x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
+ y.expectStaticType<Exactly<Object>>(),
])) {
x.expectStaticType<Exactly<Object>>();
y.expectStaticType<Exactly<Object>>();
@@ -490,7 +504,7 @@
}
if (_alwaysFalse([
x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
+ y.expectStaticType<Exactly<Object>>(),
]) ||
b) {
x.expectStaticType<Exactly<Object>>();
@@ -520,12 +534,14 @@
} while (b);
x.expectStaticType<Exactly<Object>>();
y.expectStaticType<Exactly<Object>>();
- for ([
- x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
- ];
- b;
- x.expectStaticType<Exactly<int>>(), y.expectStaticType<Exactly<int>>()) {
+ for (
+ [
+ x.expectStaticType<Exactly<Object>>(),
+ y.expectStaticType<Exactly<Object>>(),
+ ];
+ b;
+ x.expectStaticType<Exactly<int>>(), y.expectStaticType<Exactly<int>>()
+ ) {
x.expectStaticType<Exactly<int>>();
y.expectStaticType<Exactly<int>>();
if (_alwaysTrue(null)) break;
@@ -551,7 +567,7 @@
if (b &&
_alwaysTrue([
x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
+ y.expectStaticType<Exactly<Object>>(),
])) {
x.expectStaticType<Exactly<Object>>();
y.expectStaticType<Exactly<Object>>();
@@ -561,7 +577,7 @@
}
if (_alwaysTrue([
x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
+ y.expectStaticType<Exactly<Object>>(),
]) &&
b) {
x.expectStaticType<Exactly<Object>>();
@@ -573,7 +589,7 @@
if (b ||
_alwaysFalse([
x.expectStaticType<Exactly<int>>(),
- y.expectStaticType<Exactly<int>>()
+ y.expectStaticType<Exactly<int>>(),
])) {
x.expectStaticType<Exactly<Object>>();
y.expectStaticType<Exactly<Object>>();
@@ -583,7 +599,7 @@
}
if (_alwaysFalse([
x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
+ y.expectStaticType<Exactly<Object>>(),
]) ||
b) {
x.expectStaticType<Exactly<Object>>();
@@ -618,13 +634,14 @@
}
x.expectStaticType<Exactly<Object>>();
y.expectStaticType<Exactly<Object>>();
- for ([
- x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()
- ];
- b;
+ for (
+ [
x.expectStaticType<Exactly<Object>>(),
- y.expectStaticType<Exactly<Object>>()) {
+ y.expectStaticType<Exactly<Object>>(),
+ ];
+ b;
+ x.expectStaticType<Exactly<Object>>(), y.expectStaticType<Exactly<Object>>()
+ ) {
x.expectStaticType<Exactly<Object>>();
y.expectStaticType<Exactly<Object>>();
if (_alwaysTrue(null)) break;
@@ -678,9 +695,11 @@
if (_alwaysTrue(null)) break;
} while (b);
x.expectStaticType<Exactly<Object>>();
- for (x.expectStaticType<Exactly<Object>>();
- b;
- x.expectStaticType<Exactly<int>>()) {
+ for (
+ x.expectStaticType<Exactly<Object>>();
+ b;
+ x.expectStaticType<Exactly<int>>()
+ ) {
x.expectStaticType<Exactly<int>>();
if (_alwaysTrue(null)) break;
}
@@ -736,9 +755,11 @@
if (_alwaysTrue(null)) break;
} while (b2);
x.expectStaticType<Exactly<Object>>();
- for (x.expectStaticType<Exactly<Object>>();
- b2;
- x.expectStaticType<Exactly<Object>>()) {
+ for (
+ x.expectStaticType<Exactly<Object>>();
+ b2;
+ x.expectStaticType<Exactly<Object>>()
+ ) {
x.expectStaticType<Exactly<Object>>();
if (_alwaysTrue(null)) break;
}
diff --git a/tests/language/nnbd/flow_analysis/local_boolean_join_equivalent_test.dart b/tests/language/nnbd/flow_analysis/local_boolean_join_equivalent_test.dart
index 17eeab7..2a7e095 100644
--- a/tests/language/nnbd/flow_analysis/local_boolean_join_equivalent_test.dart
+++ b/tests/language/nnbd/flow_analysis/local_boolean_join_equivalent_test.dart
@@ -71,7 +71,7 @@
if (b1)
[b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]
else
- [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]
+ [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null],
];
if (b2) x.expectStaticType<Exactly<int?>>();
}
@@ -81,7 +81,7 @@
if (b1)
[b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]
else
- [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]
+ [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null],
});
if (b2) x.expectStaticType<Exactly<int?>>();
}
@@ -91,7 +91,7 @@
if (b1)
[b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]: null
else
- [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]: null
+ [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]: null,
});
if (b2) x.expectStaticType<Exactly<int?>>();
}
@@ -101,7 +101,7 @@
if (b1)
null: [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]
else
- null: [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null]
+ null: [b2 = x != null, b2 ? x.expectStaticType<Exactly<int>>() : null],
});
if (b2) x.expectStaticType<Exactly<int?>>();
}
@@ -161,7 +161,7 @@
{
try {
bool b2;
- for (;; _alwaysThrow(b2 ? x.expectStaticType<Exactly<int?>>() : null)) {
+ for (; ; _alwaysThrow(b2 ? x.expectStaticType<Exactly<int?>>() : null)) {
if (b1) {
b2 = x != null;
if (b2) x.expectStaticType<Exactly<int>>();
diff --git a/tests/language/nnbd/flow_analysis/local_boolean_undefeated_by_assignment_test.dart b/tests/language/nnbd/flow_analysis/local_boolean_undefeated_by_assignment_test.dart
index da6178c..2c2f79a 100644
--- a/tests/language/nnbd/flow_analysis/local_boolean_undefeated_by_assignment_test.dart
+++ b/tests/language/nnbd/flow_analysis/local_boolean_undefeated_by_assignment_test.dart
@@ -110,7 +110,7 @@
if (b) x.expectStaticType<Exactly<int>>();
[
if (b2)
- [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
];
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -121,7 +121,7 @@
bool b = x != null;
if (b) x.expectStaticType<Exactly<int>>();
[
- if (b2) [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ if (b2) [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
];
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -135,7 +135,7 @@
if (b2)
null
else
- [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
];
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -149,7 +149,7 @@
if (b2)
null
else
- [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
];
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -161,7 +161,7 @@
if (b) x.expectStaticType<Exactly<int>>();
({
if (b2)
- [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -172,7 +172,7 @@
bool b = x != null;
if (b) x.expectStaticType<Exactly<int>>();
({
- if (b2) [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ if (b2) [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -186,7 +186,7 @@
if (b2)
null
else
- [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ [b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -200,7 +200,7 @@
if (b2)
null
else
- [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -213,7 +213,7 @@
({
if (b2)
[b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']:
- null
+ null,
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -225,7 +225,7 @@
if (b) x.expectStaticType<Exactly<int>>();
({
if (b2)
- [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']: null
+ [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']: null,
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -240,7 +240,7 @@
null: null
else
[b = true, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']:
- null
+ null,
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -254,7 +254,7 @@
if (b2)
null: null
else
- [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']: null
+ [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']: null,
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -269,8 +269,8 @@
null: [
b = true,
if (b) x.expectStaticType<Exactly<int?>>(),
- throw 'foo'
- ]
+ throw 'foo',
+ ],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -282,7 +282,7 @@
if (b) x.expectStaticType<Exactly<int>>();
({
if (b2)
- null: [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ null: [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -299,8 +299,8 @@
null: [
b = true,
if (b) x.expectStaticType<Exactly<int?>>(),
- throw 'foo'
- ]
+ throw 'foo',
+ ],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
@@ -314,7 +314,7 @@
if (b2)
null: null
else
- null: [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo']
+ null: [x = y, if (b) x.expectStaticType<Exactly<int?>>(), throw 'foo'],
});
if (b) x.expectStaticType<Exactly<int>>();
} on String {}
diff --git a/tests/language/nnbd/flow_analysis/null_shorting_in_cascade_test.dart b/tests/language/nnbd/flow_analysis/null_shorting_in_cascade_test.dart
index c78a2b8..4dd8485 100644
--- a/tests/language/nnbd/flow_analysis/null_shorting_in_cascade_test.dart
+++ b/tests/language/nnbd/flow_analysis/null_shorting_in_cascade_test.dart
@@ -18,64 +18,80 @@
class D {
void f([Object? value]) {}
D get d => this;
- D operator[](int index) => this;
- operator[]=(int index, Object? value) {}
+ D operator [](int index) => this;
+ operator []=(int index, Object? value) {}
}
class E {
void f([Object? value]) {}
- E? operator[](int index) => null;
- operator[]=(int index, Object? value) {}
+ E? operator [](int index) => null;
+ operator []=(int index, Object? value) {}
}
testMethodInvocation(C<D?> c, int? i) {
// The null shorting for the method invocation `.._t?.f()` ends at the end of
// the cascade section, therefore in the cascade section that follows, `.._t`
// has static type `D?`.
- c.._t?.f().._t.expectStaticType<Exactly<D?>>();
+ c
+ .._t?.f()
+ .._t.expectStaticType<Exactly<D?>>();
// The null shorting for the method invocation `..t?.f(i!)` ends at the end of
// the cascade section, therefore in the cascade section that follows, `i` is
// not promoted.
- c..t?.f(i!)..t?.f(i.expectStaticType<Exactly<int?>>());
+ c
+ ..t?.f(i!)
+ ..t?.f(i.expectStaticType<Exactly<int?>>());
}
testPropertyGet(C<D?> c, int? i) {
// The null shorting for the property get `.._t?.d` ends at the end of the
// cascade section, therefore in the cascade section that follows, `.._t` has
// static type `D?`.
- c.._t?.d.f().._t.expectStaticType<Exactly<D?>>();
+ c
+ .._t?.d.f()
+ .._t.expectStaticType<Exactly<D?>>();
// The null shorting for the property get `..t?.d` ends at the end of the
// cascade section, therefore in the cascade section that follows, `i` is not
// promoted.
- c..t?.d.f(i!)..t?.f(i.expectStaticType<Exactly<int?>>());
+ c
+ ..t?.d.f(i!)
+ ..t?.f(i.expectStaticType<Exactly<int?>>());
}
testPropertySet(C<D?> c, int? i) {
// The null shorting for the property set `..t ??= i!` ends at the end of the
// cascade section, therefore in the cascade section that follows, `i` is not
// promoted.
- c..t ??= i!..t?.f(i.expectStaticType<Exactly<int?>>());
+ c
+ ..t ??= i!
+ ..t?.f(i.expectStaticType<Exactly<int?>>());
}
testIndexGet(C<D?> c, int? i) {
// The null shorting for the index get `.._t?[0]` ends at the end of the
// cascade section, therefore in the cascade section that follows, `.._t` has
// static type `D?`.
- c.._t?[0].f().._t.expectStaticType<Exactly<D?>>();
+ c
+ .._t?[0].f()
+ .._t.expectStaticType<Exactly<D?>>();
// The null shorting for the index get `..t?[0]` ends at the end of the
// cascade section, therefore in the cascade section that follows, `i` is not
// promoted.
- c..t?[0].f(i!)..t?.f(i.expectStaticType<Exactly<int?>>());
+ c
+ ..t?[0].f(i!)
+ ..t?.f(i.expectStaticType<Exactly<int?>>());
}
testIndexSet(C<E> c, int? i) {
// The null shorting for the index set `..t?[0] ??= i!` ends at the end of the
// cascade section, therefore in the cascade section that follows, `i` is not
// promoted.
- c..t[0] ??= i!..t.f(i.expectStaticType<Exactly<int?>>());
+ c
+ ..t[0] ??= i!
+ ..t.f(i.expectStaticType<Exactly<int?>>());
}
main() {
diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart
index f6135fb..55ecb7b 100644
--- a/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart
+++ b/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart
@@ -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.
-
Never? get neverQuestionGetter => null;
void explicitNeverQuestionType(Object x, bool b) {
@@ -19,9 +18,9 @@
// Since the read of `neverQuestionGetter` was reachable, `x` is not promoted
// to `int`.
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
-// [cfe] unspecified
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
+ // [cfe] The getter 'isEven' isn't defined for the class 'Object'.
}
main() {
diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart
index d836304..cb613af 100644
--- a/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart
+++ b/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart
@@ -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.
-
Never? neverQuestionFunction() => null;
void explicitNeverQuestionType(Object x, bool b) {
@@ -19,9 +18,9 @@
// Since completion of `neverQuestionFunction` was reachable, `x` is not
// promoted to `int`.
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
-// [cfe] unspecified
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
+ // [cfe] The getter 'isEven' isn't defined for the class 'Object'.
}
main() {
diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart
index 0e12a22..d19446d 100644
--- a/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart
+++ b/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart
@@ -16,9 +16,9 @@
}
// Since the `y is Never?` branch was reachable, `x` is not promoted to `int`.
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
-// [cfe] unspecified
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
+ // [cfe] The getter 'isEven' isn't defined for the class 'Object'.
}
main() {
diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_promotion_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_promotion_test.dart
index ef4df3b..5116796 100644
--- a/tests/language/nnbd/flow_analysis/unreachable_via_promotion_test.dart
+++ b/tests/language/nnbd/flow_analysis/unreachable_via_promotion_test.dart
@@ -22,7 +22,9 @@
}
void promoteViaIsCheck_typeVarExtendsNever<T extends Never>(
- Object x, Object? y) {
+ Object x,
+ Object? y,
+) {
if (x is! int) {
if (y is T) {
// Unreachable
diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart
index 5c7634e..964d2f0 100644
--- a/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart
+++ b/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart
@@ -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.
-
void explicitNeverQuestionType(Object x, bool b) {
Never? y = null;
if (x is! int) {
@@ -17,9 +16,9 @@
}
// Since the read of `y` was reachable, `x` is not promoted to `int`.
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
-// [cfe] unspecified
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
+ // [cfe] The getter 'isEven' isn't defined for the class 'Object'.
}
main() {
diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_test.dart
index 27b7d40..d6e43df 100644
--- a/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_test.dart
+++ b/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_test.dart
@@ -27,7 +27,11 @@
}
void typeVarExtendsNever<T extends Never>(
- T Function() f, Object x, bool b1, bool b2) {
+ T Function() f,
+ Object x,
+ bool b1,
+ bool b2,
+) {
late T y;
// Loop so that flow analysis no longer can tell that y is definitely
// unassigned
diff --git a/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart b/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart
index 9df5cad..8436146 100644
--- a/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart
+++ b/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart
@@ -23,7 +23,7 @@
void forLoopAssignInUpdater(Object x) {
if (x is int) {
print(x.isEven); // Verify that promotion occurred
- for (;; x = 0) {
+ for (; ; x = 0) {
// The assignment to x does de-promote because it happens after the top of
// the loop, so flow analysis cannot check that the assigned value is an
// int at the time de-promotion occurs.
diff --git a/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_test.dart b/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_test.dart
index a385715..3a4f0a2 100644
--- a/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_test.dart
+++ b/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_test.dart
@@ -7,7 +7,7 @@
void forLoopWithoutDecl(Object x) {
if (x is int) {
- for (x = 0;;) {
+ for (x = 0; ;) {
// The assignment to x does not de-promote x because it happens before the
// top of the loop, and it assigns an int (which is compatible with the
// promoted type).
@@ -20,7 +20,7 @@
void forLoopWithoutDeclAssignInRHS(Object x) {
if (x is int) {
int y;
- for (y = (x = 0);;) {
+ for (y = (x = 0); ;) {
// The assignment to x does not de-promote x because it happens before the
// top of the loop, and it assigns an int (which is compatible with the
// promoted type).
@@ -32,7 +32,7 @@
void forLoopWithDeclAssignInRHS(Object x) {
if (x is int) {
- for (int y = (x = 0);;) {
+ for (int y = (x = 0); ;) {
// The assignment to x does not de-promote x because it happens before the
// top of the loop, and it assigns an int (which is compatible with the
// promoted type).
diff --git a/tests/language/nnbd/late/instance_field_initializers_test.dart b/tests/language/nnbd/late/instance_field_initializers_test.dart
index 4db6816..b53f219 100644
--- a/tests/language/nnbd/late/instance_field_initializers_test.dart
+++ b/tests/language/nnbd/late/instance_field_initializers_test.dart
@@ -22,14 +22,9 @@
late int c = log(-1);
late final int d = log(-2);
- Foo.withC()
- : a = log(1),
- b = log(2),
- c = log(3);
+ Foo.withC() : a = log(1), b = log(2), c = log(3);
- Foo.withoutC()
- : a = log(1),
- b = log(2);
+ Foo.withoutC() : a = log(1), b = log(2);
}
void testInitializerList() {
diff --git a/tests/language/nnbd/never/never_error_test.dart b/tests/language/nnbd/never/never_error_test.dart
index e4aa598..1ac1330 100644
--- a/tests/language/nnbd/never/never_error_test.dart
+++ b/tests/language/nnbd/never/never_error_test.dart
@@ -55,10 +55,10 @@
staticErrorIfNotNever(x == x);
staticErrorIfNotNever(x == 3);
staticErrorIfNotNever(3 == x);
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
-// ^
-// [cfe] The argument type 'bool' can't be assigned to the parameter type 'Never'.
+ // ^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // ^
+ // [cfe] The argument type 'bool' can't be assigned to the parameter type 'Never'.
}
}
@@ -82,16 +82,16 @@
{
var t = NeverExt(x).neverMethod();
staticErrorIfNotNever(t);
-// ^
-// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
-// [cfe] The argument type 'int' can't be assigned to the parameter type 'Never'.
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'int' can't be assigned to the parameter type 'Never'.
}
{
var t = ObjectExt(x).objectMethod();
staticErrorIfNotNever(t);
-// ^
-// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
-// [cfe] The argument type 'int' can't be assigned to the parameter type 'Never'.
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'int' can't be assigned to the parameter type 'Never'.
}
}
diff --git a/tests/language/nnbd/never/never_null_assignability_error_test.dart b/tests/language/nnbd/never/never_null_assignability_error_test.dart
index ee485d9..d51ce54 100644
--- a/tests/language/nnbd/never/never_null_assignability_error_test.dart
+++ b/tests/language/nnbd/never/never_null_assignability_error_test.dart
@@ -202,14 +202,12 @@
void main() {
never = null;
- // ^
- // [analyzer] unspecified
- // ^
+ // ^^^^
+ // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [cfe] The value 'null' can't be assigned to a variable of type 'Never' because 'Never' is not nullable.
never = nil;
- // ^
- // [analyzer] unspecified
- // ^
+ // ^^^
+ // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [cfe] A value of type 'Null' can't be assigned to a variable of type 'Never' because 'Never' is not nullable.
nil = never;
testNullSafeCalls();
diff --git a/tests/language/nnbd/normalization/generic_function_type_object_normalization_test.dart b/tests/language/nnbd/normalization/generic_function_type_object_normalization_test.dart
index b7be0f3..e37fbc1 100644
--- a/tests/language/nnbd/normalization/generic_function_type_object_normalization_test.dart
+++ b/tests/language/nnbd/normalization/generic_function_type_object_normalization_test.dart
@@ -145,12 +145,10 @@
Future<Never> h2<S extends T, R extends S>(Null x) => throw "Unused";
void Function<S0 extends FutureOr<R>, S1 extends R, S2 extends R?>()
- i1<R>() =>
- <T0 extends FutureOr<R>, T1 extends R, T2 extends R?>() {};
+ i1<R>() => <T0 extends FutureOr<R>, T1 extends R, T2 extends R?>() {};
void Function<S0 extends Future<Never>, S1 extends Never, S2 extends Null>()
- i2<R>() =>
- <R0 extends Future<Never>, R1 extends Never, R2 extends Null>() {};
+ i2<R>() => <R0 extends Future<Never>, R1 extends Never, R2 extends Null>() {};
}
void neverBoundTests() {
diff --git a/tests/language/nnbd/normalization/type_builder.dart b/tests/language/nnbd/normalization/type_builder.dart
index c858dc5..185aa48 100644
--- a/tests/language/nnbd/normalization/type_builder.dart
+++ b/tests/language/nnbd/normalization/type_builder.dart
@@ -145,7 +145,7 @@
typeObjectOf(a),
typeObjectOf(b),
noSuchMethodTypeOf(a),
- noSuchMethodTypeOf(b)
+ noSuchMethodTypeOf(b),
]);
checkAllEquals([
@@ -154,7 +154,7 @@
noSuchMethodTypeOf($Rep(a)),
noSuchMethodTypeOf($Rep(b)),
runtimeTypeOfRepOf(a),
- runtimeTypeOfRepOf(b)
+ runtimeTypeOfRepOf(b),
]);
}
diff --git a/tests/language/nnbd/normalization/type_object_normalization_test.dart b/tests/language/nnbd/normalization/type_object_normalization_test.dart
index 9d3ebbe8..9a0778d 100644
--- a/tests/language/nnbd/normalization/type_object_normalization_test.dart
+++ b/tests/language/nnbd/normalization/type_object_normalization_test.dart
@@ -59,7 +59,9 @@
// FutureOr<T>? is FutureOr<T> if T is nullable
checkTypeEqualities(
- $OrNull($FutureOr($OrNull($int))), $FutureOr($OrNull($int)));
+ $OrNull($FutureOr($OrNull($int))),
+ $FutureOr($OrNull($int)),
+ );
// FutureOr<T>? is not FutureOr<T> if T is not nullable
checkTypeInequalities($OrNull($FutureOr($int)), $FutureOr($int));
@@ -80,33 +82,48 @@
// B Function(A) is D Function(C) if A is C and B is D
checkTypeEqualities(
- $Function1(
- $OrNull($FutureOr($OrNull($Null))), $FutureOr($FutureOr($Object))),
- $Function1($OrNull($Future($Null)), $Object));
+ $Function1(
+ $OrNull($FutureOr($OrNull($Null))),
+ $FutureOr($FutureOr($Object)),
+ ),
+ $Function1($OrNull($Future($Null)), $Object),
+ );
// B Function({A a}) is D Function({C a}) if A is C and B is D
checkTypeEqualities(
- $FunctionOptionalNamedA(
- $OrNull($FutureOr($OrNull($Null))), $FutureOr($FutureOr($Object))),
- $FunctionOptionalNamedA($OrNull($Future($Null)), $Object));
+ $FunctionOptionalNamedA(
+ $OrNull($FutureOr($OrNull($Null))),
+ $FutureOr($FutureOr($Object)),
+ ),
+ $FunctionOptionalNamedA($OrNull($Future($Null)), $Object),
+ );
// B Function({A a}) is not D Function({C b}) even if A is C and B is D
checkTypeInequalities(
- $FunctionOptionalNamedA(
- $OrNull($FutureOr($OrNull($Null))), $FutureOr($FutureOr($Object))),
- $FunctionOptionalNamedB($OrNull($Future($Null)), $Object));
+ $FunctionOptionalNamedA(
+ $OrNull($FutureOr($OrNull($Null))),
+ $FutureOr($FutureOr($Object)),
+ ),
+ $FunctionOptionalNamedB($OrNull($Future($Null)), $Object),
+ );
// B Function({required A a}) is D Function({required C a}) if A is C and B is D
checkTypeEqualities(
- $FunctionRequiredNamedA(
- $OrNull($FutureOr($OrNull($Null))), $FutureOr($FutureOr($Object))),
- $FunctionRequiredNamedA($OrNull($Future($Null)), $Object));
+ $FunctionRequiredNamedA(
+ $OrNull($FutureOr($OrNull($Null))),
+ $FutureOr($FutureOr($Object)),
+ ),
+ $FunctionRequiredNamedA($OrNull($Future($Null)), $Object),
+ );
// B Function({required A a}) is not D Function({C a}) even if A is C and B is D
checkTypeInequalities(
- $FunctionRequiredNamedA(
- $OrNull($FutureOr($OrNull($Null))), $FutureOr($FutureOr($Object))),
- $FunctionOptionalNamedA($OrNull($Future($Null)), $Object));
+ $FunctionRequiredNamedA(
+ $OrNull($FutureOr($OrNull($Null))),
+ $FutureOr($FutureOr($Object)),
+ ),
+ $FunctionOptionalNamedA($OrNull($Future($Null)), $Object),
+ );
}
void main() {
diff --git a/tests/language/nnbd/operator_type_test.dart b/tests/language/nnbd/operator_type_test.dart
index 3136130..8cc4e88 100644
--- a/tests/language/nnbd/operator_type_test.dart
+++ b/tests/language/nnbd/operator_type_test.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.
-
// Tests that language operators and constructs requiring non-nullable values
// will not accept an operand with a nullable static type.
// See: https://github.com/dart-lang/language/issues/298
@@ -25,99 +24,98 @@
x = bq && b;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = b && bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = bq || b;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = b || bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = !bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = bq ? "a" : "b";
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
if (bq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
while (bq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
do {} while (bq);
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
for (; bq;) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
try {
throw bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.THROW_OF_INVALID_TYPE
// [cfe] Can't throw a value of 'bool?' since it is neither dynamic nor non-nullable.
} catch (e) {}
assert(bq);
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = [if (bq) 1];
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = [for (; bq;) 1];
- // ^^
- // [analyzer] unspecified
- // ^
+ // ^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
Iterable<int>? iq = maybeNullable([1]);
for (var v in iq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'Iterable<int>?' is nullable and 'Iterable<dynamic>' isn't.
x = [...iq];
- // ^
+ // ^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] An expression whose value can be 'null' must be null-checked before it can be dereferenced.
- // ^^
- // [analyzer] unspecified
Stream<Object?> foo() async* {
Stream<int>? sq = maybeNullable(Stream<int>.fromIterable([1]));
await for (var v in sq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Stream<int>?' used in the 'for' loop must implement 'Stream<dynamic>' because 'Stream<int>?' is nullable and 'Stream<dynamic>' isn't.
yield* sq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [analyzer] COMPILE_TIME_ERROR.YIELD_OF_INVALID_TYPE
// [cfe] A value of type 'Stream<int>?' can't be assigned to a variable of type 'Stream<Object?>' because 'Stream<int>?' is nullable and 'Stream<Object?>' isn't.
}
@@ -138,98 +136,99 @@
x = bq && b;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = b && bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = bq || b;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = b || bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = !bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_NEGATION_EXPRESSION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = bq ? "a" : "b";
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
if (bq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
while (bq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
do {} while (bq);
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
for (; bq;) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
try {
throw bq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.THROW_OF_INVALID_TYPE
// [cfe] Can't throw a value of 'BQ' since it is neither dynamic nor non-nullable.
} catch (e) {}
assert(bq);
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = [if (bq) 1];
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
x = [for (; bq;) 1];
- // ^^
- // [analyzer] unspecified
- // ^
+ // ^^
+ // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION
// [cfe] A value of type 'BQ' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
Iterable<int>? iq = maybeNullable([1]);
for (var v in iq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'Iterable<int>?' is nullable and 'Iterable<dynamic>' isn't.
x = [...iq];
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] An expression whose value can be 'null' must be null-checked before it can be dereferenced.
Stream<Object?> foo<SQ extends Stream<Object?>?>() async* {
SQ sq = maybeNotNullable<SQ>(Stream<int>.fromIterable([1]));
await for (var v in sq) {}
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Stream<Object?>?' used in the 'for' loop must implement 'Stream<dynamic>' because 'Stream<Object?>?' is nullable and 'Stream<dynamic>' isn't.
yield* sq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [analyzer] COMPILE_TIME_ERROR.YIELD_OF_INVALID_TYPE
// [cfe] A value of type 'SQ' can't be assigned to a variable of type 'Stream<Object?>' because 'Stream<Object?>?' is nullable and 'Stream<Object?>' isn't.
}
@@ -251,7 +250,7 @@
// A factory constructor must not return `null`.
return cq;
// ^^
- // [analyzer] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
// [cfe] A value of type 'C?' can't be returned from a function with return type 'C' because 'C?' is nullable and 'C' isn't.
}
}
@@ -265,33 +264,33 @@
dynamic x;
x = nn ?? 1;
- // ^^
- // [analyzer] unspecified
+ // ^
+ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
x = nn ??= 1;
- // ^^
- // [analyzer] unspecified
+ // ^
+ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
x = nn?.toRadixString(16);
- // ^^
- // [analyzer] unspecified
+ // ^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
x = nn?..toRadixString(16);
- // ^^
- // [analyzer] unspecified
+ // ^^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
x = nn!;
- // ^^
- // [analyzer] unspecified
+ // ^
+ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION
List<int> nni = [1];
x = [...?nni];
- // ^^^
- // [analyzer] unspecified
+ // ^^^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
x = nni?[0];
- // ^^^
- // [analyzer] unspecified
+ // ^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
return x;
}
diff --git a/tests/language/nnbd/required_named_parameters/missing_required_argument_dynamic_test.dart b/tests/language/nnbd/required_named_parameters/missing_required_argument_dynamic_test.dart
index 8857a6b..5d65c1d 100644
--- a/tests/language/nnbd/required_named_parameters/missing_required_argument_dynamic_test.dart
+++ b/tests/language/nnbd/required_named_parameters/missing_required_argument_dynamic_test.dart
@@ -17,59 +17,60 @@
F m2() => ({required String x}) => 'm2: $x';
// Check a mix of required and optional.
- int m3(
- {required int p1,
- int p2 = 2,
- int p3 = 3,
- int p4 = 4,
- int p5 = 5,
- required int p6,
- int p7 = 7,
- required int p8,
- int p9 = 9,
- int p10 = 10}) =>
- p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
+ int m3({
+ required int p1,
+ int p2 = 2,
+ int p3 = 3,
+ int p4 = 4,
+ int p5 = 5,
+ required int p6,
+ int p7 = 7,
+ required int p8,
+ int p9 = 9,
+ int p10 = 10,
+ }) => p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
// Check a case where at least one of the VM required flag packed entries
// should be represented by the null Smi. (Need at least 32 optional
// parameters on 64-bit architectures for this.)
- int m4(
- {int p1 = 1,
- int p2 = 2,
- int p3 = 3,
- int p4 = 4,
- int p5 = 5,
- int p6 = 6,
- int p7 = 7,
- int p8 = 8,
- int p9 = 9,
- int p10 = 10,
- int p11 = 11,
- int p12 = 12,
- int p13 = 13,
- int p14 = 14,
- int p15 = 15,
- int p16 = 16,
- int p17 = 17,
- int p18 = 18,
- int p19 = 19,
- int p20 = 20,
- int p21 = 21,
- int p22 = 22,
- int p23 = 23,
- int p24 = 24,
- int p25 = 25,
- int p26 = 26,
- int p27 = 27,
- int p28 = 28,
- int p29 = 29,
- int p30 = 30,
- int p31 = 31,
- int p32 = 32,
- int p33 = 33,
- int p34 = 34,
- int p35 = 35,
- required int p36}) =>
+ int m4({
+ int p1 = 1,
+ int p2 = 2,
+ int p3 = 3,
+ int p4 = 4,
+ int p5 = 5,
+ int p6 = 6,
+ int p7 = 7,
+ int p8 = 8,
+ int p9 = 9,
+ int p10 = 10,
+ int p11 = 11,
+ int p12 = 12,
+ int p13 = 13,
+ int p14 = 14,
+ int p15 = 15,
+ int p16 = 16,
+ int p17 = 17,
+ int p18 = 18,
+ int p19 = 19,
+ int p20 = 20,
+ int p21 = 21,
+ int p22 = 22,
+ int p23 = 23,
+ int p24 = 24,
+ int p25 = 25,
+ int p26 = 26,
+ int p27 = 27,
+ int p28 = 28,
+ int p29 = 29,
+ int p30 = 30,
+ int p31 = 31,
+ int p32 = 32,
+ int p33 = 33,
+ int p34 = 34,
+ int p35 = 35,
+ required int p36,
+ }) =>
p1 +
p2 +
p3 +
@@ -113,59 +114,60 @@
String Function({required int a}) g() => ({required int a}) => 'g';
// Check a mix of required and optional.
-int h(
- {required int p1,
- int p2 = 2,
- int p3 = 3,
- int p4 = 4,
- int p5 = 5,
- int p6 = 6,
- int p7 = 7,
- required int p8,
- int p9 = 9,
- required int p10}) =>
- p1 + p2 - p3 + p4 - p5 + p6 - p7 + p8 - p9 + p10;
+int h({
+ required int p1,
+ int p2 = 2,
+ int p3 = 3,
+ int p4 = 4,
+ int p5 = 5,
+ int p6 = 6,
+ int p7 = 7,
+ required int p8,
+ int p9 = 9,
+ required int p10,
+}) => p1 + p2 - p3 + p4 - p5 + p6 - p7 + p8 - p9 + p10;
// Check a case where at least one of the VM required flag packed entries
// should be represented by the null Smi. (Need at least 32 optional
// parameters on 64-bit architectures for this.)
-int i(
- {int p1 = 1,
- int p2 = 2,
- int p3 = 3,
- int p4 = 4,
- int p5 = 5,
- int p6 = 6,
- int p7 = 7,
- int p8 = 8,
- int p9 = 9,
- int p10 = 10,
- int p11 = 11,
- int p12 = 12,
- int p13 = 13,
- int p14 = 14,
- int p15 = 15,
- int p16 = 16,
- int p17 = 17,
- int p18 = 18,
- int p19 = 19,
- int p20 = 20,
- int p21 = 21,
- int p22 = 22,
- int p23 = 23,
- int p24 = 24,
- int p25 = 25,
- int p26 = 26,
- int p27 = 27,
- int p28 = 28,
- int p29 = 29,
- int p30 = 30,
- int p31 = 31,
- int p32 = 32,
- int p33 = 33,
- required int p34,
- int p35 = 35,
- int p36 = 36}) =>
+int i({
+ int p1 = 1,
+ int p2 = 2,
+ int p3 = 3,
+ int p4 = 4,
+ int p5 = 5,
+ int p6 = 6,
+ int p7 = 7,
+ int p8 = 8,
+ int p9 = 9,
+ int p10 = 10,
+ int p11 = 11,
+ int p12 = 12,
+ int p13 = 13,
+ int p14 = 14,
+ int p15 = 15,
+ int p16 = 16,
+ int p17 = 17,
+ int p18 = 18,
+ int p19 = 19,
+ int p20 = 20,
+ int p21 = 21,
+ int p22 = 22,
+ int p23 = 23,
+ int p24 = 24,
+ int p25 = 25,
+ int p26 = 26,
+ int p27 = 27,
+ int p28 = 28,
+ int p29 = 29,
+ int p30 = 30,
+ int p31 = 31,
+ int p32 = 32,
+ int p33 = 33,
+ required int p34,
+ int p35 = 35,
+ int p36 = 36,
+}) =>
p1 +
p2 -
p3 +
@@ -226,7 +228,8 @@
Expect.throwsNoSuchMethodError(() => (h as dynamic)(p1: 1, p6: 6, p10: 10));
Expect.equals(55, (a.m3 as dynamic)(p1: 1, p6: 6, p8: 8));
Expect.throwsNoSuchMethodError(
- () => (a.m3 as dynamic)(p1: 1, p8: 8, p10: 10));
+ () => (a.m3 as dynamic)(p1: 1, p8: 8, p10: 10),
+ );
Expect.equals(55, b.m3(p1: 1, p6: 6, p8: 8));
Expect.throwsNoSuchMethodError(() => b.m3(p1: 1, p8: 8, p10: 10));
diff --git a/tests/language/nnbd/required_named_parameters/required_named_args_strong_test.dart b/tests/language/nnbd/required_named_parameters/required_named_args_strong_test.dart
index 5f7cd58..4851b68 100644
--- a/tests/language/nnbd/required_named_parameters/required_named_args_strong_test.dart
+++ b/tests/language/nnbd/required_named_parameters/required_named_args_strong_test.dart
@@ -13,19 +13,12 @@
// Invalid: Subtype may not redeclare optional parameters as required.
Expect.throwsTypeError(() {
- Function(
- String p0, {
- required int p1,
- String p2,
- }) t2 = f;
+ Function(String p0, {required int p1, String p2}) t2 = f;
});
// Invalid: Subtype may not declare new required named parameters.
Expect.throwsTypeError(() {
- Function(
- String p0, {
- required int p1,
- }) t3 = f;
+ Function(String p0, {required int p1}) t3 = f;
});
// Invalid: Invocation with explicit null required named argument.
diff --git a/tests/language/nnbd/required_named_parameters/required_named_args_test.dart b/tests/language/nnbd/required_named_parameters/required_named_args_test.dart
index d19b0eb..47fc720 100644
--- a/tests/language/nnbd/required_named_parameters/required_named_args_test.dart
+++ b/tests/language/nnbd/required_named_parameters/required_named_args_test.dart
@@ -15,7 +15,7 @@
// Valid: Subtype may redeclare required named parameters as optional.
Function(String p0, {required int p1, required String p2, required bool p3})
- t1 = f;
+ t1 = f;
// Valid: Invocation with all arguments provided.
f("", p1: 100, p2: "", p3: true);
diff --git a/tests/language/nnbd/required_named_parameters/required_named_args_weak_test.dart b/tests/language/nnbd/required_named_parameters/required_named_args_weak_test.dart
index 7d161e9..556ca2d 100644
--- a/tests/language/nnbd/required_named_parameters/required_named_args_weak_test.dart
+++ b/tests/language/nnbd/required_named_parameters/required_named_args_weak_test.dart
@@ -12,17 +12,10 @@
dynamic f = func;
// Valid: Subtype may redeclare optional parameters as required in weak mode.
- Function(
- String p0, {
- required int p1,
- String p2,
- }) t2 = f;
+ Function(String p0, {required int p1, String p2}) t2 = f;
// Valid: Subtype may declare new required named parameters in weak mode.
- Function(
- String p0, {
- required int p1,
- }) t3 = f;
+ Function(String p0, {required int p1}) t3 = f;
// Valid: Invocation may pass null as a required named argument in weak mode.
f("", p1: null, p2: null);
diff --git a/tests/language/nnbd/resolution/issue40931_test.dart b/tests/language/nnbd/resolution/issue40931_test.dart
index 6579324..ddb7065 100644
--- a/tests/language/nnbd/resolution/issue40931_test.dart
+++ b/tests/language/nnbd/resolution/issue40931_test.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.
-
main() {}
extension E<T> on T? {
diff --git a/tests/language/nnbd/resolution/issue41479_test.dart b/tests/language/nnbd/resolution/issue41479_test.dart
index f818072..7a1dfc0 100644
--- a/tests/language/nnbd/resolution/issue41479_test.dart
+++ b/tests/language/nnbd/resolution/issue41479_test.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.
-
main() {
A a = A()..foo?.isEven;
}
diff --git a/tests/language/nnbd/resolution/null_assertion_null_type_test.dart b/tests/language/nnbd/resolution/null_assertion_null_type_test.dart
index 14f2060..b663e1a 100644
--- a/tests/language/nnbd/resolution/null_assertion_null_type_test.dart
+++ b/tests/language/nnbd/resolution/null_assertion_null_type_test.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.
-
// 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
// non-null parameter.
@@ -11,7 +10,7 @@
void f(int i) {}
void g(Null n) {
- // Statically ok because `Never <: int`. Throws at runtime.
+ // Statically ok because `Never <: int`. Throws at runtime.
f(n!);
}
diff --git a/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart b/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart
index c0bd3e2..abbd15f 100644
--- a/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart
+++ b/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart
@@ -18,43 +18,44 @@
void f2(NotGeneric? x) {
x?[0] + 1;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
-// [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] Operator '+' cannot be called on 'int?' because it is potentially null.
x?[0] = 1;
useNonNullable(x?[0] = 1);
-// ^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
-// [cfe] unspecified
+ // ^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't.
x?[0] += 1;
useNonNullable(x?[0] += 1);
-// ^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
-// [cfe] unspecified
+ // ^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't.
x?[0]++;
useNonNullable(x?[0]++);
-// ^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
-// [cfe] unspecified
+ // ^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't.
++x?[0];
useNonNullable(++x?[0]);
-// ^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
-// [cfe] unspecified
+ // ^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // ^
+ // [cfe] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't.
}
void f3<T extends num>(Generic<T>? x) {
x?[0] + 1;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
-// [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] Operator '+' cannot be called on 'T?' because it is potentially null.
}
void f4<T extends num>(Generic<T?> x) {
x[0] + 1;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
-// [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] Operator '+' cannot be called on 'T?' because it is potentially null.
}
class NotGeneric {
diff --git a/tests/language/nnbd/resolution/question_question_lub_test.dart b/tests/language/nnbd/resolution/question_question_lub_test.dart
index 8d36ecf..3bb3ca9 100644
--- a/tests/language/nnbd/resolution/question_question_lub_test.dart
+++ b/tests/language/nnbd/resolution/question_question_lub_test.dart
@@ -2,30 +2,26 @@
// 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.
-
// Test that `x ?? y` results in type LUB(x!, y)
void main() {
f1(null, 2);
}
-void f1(
- int? nullableInt,
- int nonNullInt,
-) {
+void f1(int? nullableInt, int nonNullInt) {
(nullableInt ?? nonNullInt) + 1;
(nullableInt ?? nullableInt) + 1;
-// ^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
-// [cfe] Operator '+' cannot be called on 'int?' because it is potentially null.
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] Operator '+' cannot be called on 'int?' because it is potentially null.
(nonNullInt ?? nullableInt) + 1;
-// ^^^^^^^^^^^
-// [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
-// ^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
-// [cfe] Operator '+' cannot be called on 'int?' because it is potentially null.
+ // ^^^^^^^^^^^
+ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] Operator '+' cannot be called on 'int?' because it is potentially null.
(nonNullInt ?? nonNullInt) + 1;
-// ^^^^^^^^^^
-// [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
+ // ^^^^^^^^^^
+ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
}
// TODO(mfairhurst) add cases with type parameter types
diff --git a/tests/language/nnbd/static_errors/equals_parameter_made_nullable_at_invoke_test.dart b/tests/language/nnbd/static_errors/equals_parameter_made_nullable_at_invoke_test.dart
index f0d1441..90ffaaf 100644
--- a/tests/language/nnbd/static_errors/equals_parameter_made_nullable_at_invoke_test.dart
+++ b/tests/language/nnbd/static_errors/equals_parameter_made_nullable_at_invoke_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
-
// Test that Object.operator==(Object o) is the signature of ==, but that we can
// still compare nullable values to Object.
//
@@ -35,5 +34,5 @@
class C {
// Valid override
@override
- bool operator==(Object other) => identical(other, this);
+ bool operator ==(Object other) => identical(other, this);
}
diff --git a/tests/language/nnbd/static_errors/not_assigned_local_if_then_else_test.dart b/tests/language/nnbd/static_errors/not_assigned_local_if_then_else_test.dart
index 3748a9e..68c613c 100644
--- a/tests/language/nnbd/static_errors/not_assigned_local_if_then_else_test.dart
+++ b/tests/language/nnbd/static_errors/not_assigned_local_if_then_else_test.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.
-
// 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
// definitely assigned.
diff --git a/tests/language/nnbd/static_errors/not_assigned_local_try_catch_body_catch_test.dart b/tests/language/nnbd/static_errors/not_assigned_local_try_catch_body_catch_test.dart
index a08dd1d..4d0fa9f 100644
--- a/tests/language/nnbd/static_errors/not_assigned_local_try_catch_body_catch_test.dart
+++ b/tests/language/nnbd/static_errors/not_assigned_local_try_catch_body_catch_test.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.
-
// 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
// definitely assigned.
diff --git a/tests/language/nnbd/static_errors/not_assigned_local_while_true_break_after_test.dart b/tests/language/nnbd/static_errors/not_assigned_local_while_true_break_after_test.dart
index 49dc8a8..b0aa3c6 100644
--- a/tests/language/nnbd/static_errors/not_assigned_local_while_true_break_after_test.dart
+++ b/tests/language/nnbd/static_errors/not_assigned_local_while_true_break_after_test.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.
-
// 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
// definitely assigned.
diff --git a/tests/language/nnbd/static_errors/super_equals_allows_null_test.dart b/tests/language/nnbd/static_errors/super_equals_allows_null_test.dart
index 4a7f98a..46b8159 100644
--- a/tests/language/nnbd/static_errors/super_equals_allows_null_test.dart
+++ b/tests/language/nnbd/static_errors/super_equals_allows_null_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
-
// 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,
// as per this spec text (from
diff --git a/tests/language/nnbd/static_errors/super_equals_disallows_non_matching_type_error_test.dart b/tests/language/nnbd/static_errors/super_equals_disallows_non_matching_type_error_test.dart
index 9f0c53c..2101619 100644
--- a/tests/language/nnbd/static_errors/super_equals_disallows_non_matching_type_error_test.dart
+++ b/tests/language/nnbd/static_errors/super_equals_disallows_non_matching_type_error_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
-
// Test that `super == x` is properly type checked against the target
// `operator==` method. That is, the special allowance in the following spec
// text (from accepted/future-releases/nnbd/feature-specification.md) allows `x`
diff --git a/tests/language/nnbd/subtyping/function_type_bounds_null_safe_lib.dart b/tests/language/nnbd/subtyping/function_type_bounds_null_safe_lib.dart
index 095512d..46106b5 100644
--- a/tests/language/nnbd/subtyping/function_type_bounds_null_safe_lib.dart
+++ b/tests/language/nnbd/subtyping/function_type_bounds_null_safe_lib.dart
@@ -9,15 +9,16 @@
typedef fnTypeWithNullableObjectBound = void Function<T extends Object?>();
typedef fnTypeWithNonNullIntBound = void Function<T extends int>();
typedef fnTypeWithNullableIntBound = void Function<T extends int?>();
-typedef fnTypeWithNonNullableStringNullableObjectBounds = void
- Function<T extends String, S extends Object?>();
+typedef fnTypeWithNonNullableStringNullableObjectBounds =
+ void Function<T extends String, S extends Object?>();
typedef fnTypeWithNeverBound = void Function<T extends Never>();
void fnWithNonNullObjectBound<T extends Object>() => null;
void fnWithNullableObjectBound<T extends Object?>() => null;
void fnWithNonNullIntBound<T extends int>() => null;
void fnWithNullableIntBound<T extends int?>() => null;
-void fnWithNonNullableStringNullableObjectBounds<T extends String,
- S extends Object?>() =>
- null;
+void fnWithNonNullableStringNullableObjectBounds<
+ T extends String,
+ S extends Object?
+>() => null;
void fnWithNullBound<T extends Null>() => null;
diff --git a/tests/language/nnbd/subtyping/function_type_bounds_test.dart b/tests/language/nnbd/subtyping/function_type_bounds_test.dart
index 55dbc26..51c1b1d 100644
--- a/tests/language/nnbd/subtyping/function_type_bounds_test.dart
+++ b/tests/language/nnbd/subtyping/function_type_bounds_test.dart
@@ -20,10 +20,14 @@
// void fn<T extends Object?>() is! void Function<T extends Object>()
// (except when using unsound null safety)
- Expect.equals(hasUnsoundNullSafety,
- fnWithNullableObjectBound is fnTypeWithNonNullObjectBound);
+ Expect.equals(
+ hasUnsoundNullSafety,
+ fnWithNullableObjectBound is fnTypeWithNonNullObjectBound,
+ );
// void fn<T extends Object>() is! void Function<T extends Object?>()
// (except when using unsound null safety)
- Expect.equals(hasUnsoundNullSafety,
- fnWithNonNullObjectBound is fnTypeWithNullableObjectBound);
+ Expect.equals(
+ hasUnsoundNullSafety,
+ fnWithNonNullObjectBound is fnTypeWithNullableObjectBound,
+ );
}
diff --git a/tests/language/nnbd/subtyping/function_type_required_params_test.dart b/tests/language/nnbd/subtyping/function_type_required_params_test.dart
index b30232c..d6d0fdc 100644
--- a/tests/language/nnbd/subtyping/function_type_required_params_test.dart
+++ b/tests/language/nnbd/subtyping/function_type_required_params_test.dart
@@ -15,77 +15,78 @@
typedef int fType({required int i});
typedef int gType({int i});
-typedef int bigType(
- {required int i1,
- required int i2,
- required int i3,
- required int i4,
- required int i5,
- required int i6,
- required int i7,
- required int i8,
- required int i9,
- required int i10,
- required int i11,
- required int i12,
- required int i13,
- required int i14,
- required int i15,
- required int i16,
- required int i17,
- required int i18,
- required int i19,
- required int i20,
- required int i21,
- required int i22,
- required int i23,
- required int i24,
- required int i25,
- required int i26,
- required int i27,
- required int i28,
- required int i29,
- required int i30,
- required int i31,
- required int i32,
- required int i33,
- required int i34,
- required int i35,
- required int i36,
- required int i37,
- required int i38,
- required int i39,
- required int i40,
- required int i41,
- required int i42,
- required int i43,
- required int i44,
- required int i45,
- required int i46,
- required int i47,
- required int i48,
- required int i49,
- required int i50,
- required int i51,
- required int i52,
- required int i53,
- required int i54,
- required int i55,
- required int i56,
- required int i57,
- required int i58,
- required int i59,
- required int i60,
- required int i61,
- required int i62,
- required int i63,
- required int i64,
- required int i65,
- required int i66,
- required int i67,
- required int i68,
- required int i69,
- required int i70});
+typedef int bigType({
+ required int i1,
+ required int i2,
+ required int i3,
+ required int i4,
+ required int i5,
+ required int i6,
+ required int i7,
+ required int i8,
+ required int i9,
+ required int i10,
+ required int i11,
+ required int i12,
+ required int i13,
+ required int i14,
+ required int i15,
+ required int i16,
+ required int i17,
+ required int i18,
+ required int i19,
+ required int i20,
+ required int i21,
+ required int i22,
+ required int i23,
+ required int i24,
+ required int i25,
+ required int i26,
+ required int i27,
+ required int i28,
+ required int i29,
+ required int i30,
+ required int i31,
+ required int i32,
+ required int i33,
+ required int i34,
+ required int i35,
+ required int i36,
+ required int i37,
+ required int i38,
+ required int i39,
+ required int i40,
+ required int i41,
+ required int i42,
+ required int i43,
+ required int i44,
+ required int i45,
+ required int i46,
+ required int i47,
+ required int i48,
+ required int i49,
+ required int i50,
+ required int i51,
+ required int i52,
+ required int i53,
+ required int i54,
+ required int i55,
+ required int i56,
+ required int i57,
+ required int i58,
+ required int i59,
+ required int i60,
+ required int i61,
+ required int i62,
+ required int i63,
+ required int i64,
+ required int i65,
+ required int i66,
+ required int i67,
+ required int i68,
+ required int i69,
+ required int i70,
+});
main() {
Expect.equals(f.runtimeType, f.runtimeType);
diff --git a/tests/language/nnbd/syntax/cascade_nullcheck_test.dart b/tests/language/nnbd/syntax/cascade_nullcheck_test.dart
index f54a5d0..b884e98 100644
--- a/tests/language/nnbd/syntax/cascade_nullcheck_test.dart
+++ b/tests/language/nnbd/syntax/cascade_nullcheck_test.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.
-
import "package:expect/expect.dart";
class C {
@@ -17,7 +16,9 @@
}
void test(C x) {
- x..f()!.g()['Hi!']!..h()!.y = 2;
+ x
+ ..f()!.g()['Hi!']!
+ ..h()!.y = 2;
}
main() {
diff --git a/tests/language/nnbd/syntax/class_member_declarations_error_test.dart b/tests/language/nnbd/syntax/class_member_declarations_error_test.dart
index 40e2c44..56c680f 100644
--- a/tests/language/nnbd/syntax/class_member_declarations_error_test.dart
+++ b/tests/language/nnbd/syntax/class_member_declarations_error_test.dart
@@ -5,14 +5,12 @@
class A {
static late x1;
- // ^^^^
- // [analyzer] unspecified
- // ^
+ // ^^
+ // [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
static late x5 = 0;
- // ^^^^
- // [analyzer] unspecified
- // ^
+ // ^^
+ // [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
static final late x9;
@@ -36,14 +34,12 @@
// [cfe] The value 'null' can't be assigned to a variable of type 'A' because 'A' is not nullable.
covariant late x15;
- // ^^^^
- // [analyzer] unspecified
- // ^
+ // ^^^
+ // [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
covariant late x16 = '';
- // ^^^^
- // [analyzer] unspecified
- // ^
+ // ^^^
+ // [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
late covariant var x17;
@@ -81,9 +77,8 @@
covariant double late x23;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD
- // [cfe] Expected ';' after this.
- // ^^^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
+ // [cfe] Expected ';' after this.
// [cfe] Field 'late' should be initialized because its type 'double' doesn't allow null.
// ^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
@@ -91,23 +86,21 @@
covariant String late x24 = '';
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
- // [cfe] 'late' is already declared in this scope.
- // ^^^^
// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD
- // [cfe] Expected ';' after this.
- // ^^^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
+ // [cfe] 'late' is already declared in this scope.
+ // [cfe] Expected ';' after this.
// ^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
late x25;
- // ^^^^
- // [analyzer] unspecified
+ // ^^^
+ // [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
late x29 = 0;
- // ^^^^
- // [analyzer] unspecified
+ // ^^^
+ // [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
final late x33;
@@ -117,12 +110,10 @@
int late x34;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
- // [cfe] 'late' is already declared in this scope.
- // ^^^^
// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD
- // [cfe] Expected ';' after this.
- // ^^^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
+ // [cfe] 'late' is already declared in this scope.
+ // [cfe] Expected ';' after this.
// ^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
@@ -141,12 +132,10 @@
int late x38 = 0;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION
- // [cfe] 'late' is already declared in this scope.
- // ^^^^
// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD
- // [cfe] Expected ';' after this.
- // ^^^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
+ // [cfe] 'late' is already declared in this scope.
+ // [cfe] Expected ';' after this.
// ^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_CONST_FINAL_VAR_OR_TYPE
// [cfe] Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
diff --git a/tests/language/nnbd/syntax/class_member_declarations_test.dart b/tests/language/nnbd/syntax/class_member_declarations_test.dart
index f53b467..0c40733 100644
--- a/tests/language/nnbd/syntax/class_member_declarations_test.dart
+++ b/tests/language/nnbd/syntax/class_member_declarations_test.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.
-
class A {
static late final x2;
static late int x3;
diff --git a/tests/language/nnbd/syntax/late_modifier_non_final_field_test.dart b/tests/language/nnbd/syntax/late_modifier_non_final_field_test.dart
index cdd0979..9b12756 100644
--- a/tests/language/nnbd/syntax/late_modifier_non_final_field_test.dart
+++ b/tests/language/nnbd/syntax/late_modifier_non_final_field_test.dart
@@ -19,9 +19,7 @@
late int? nullableFieldWithNoInit;
late int? fieldWithOnlyCtorInit;
late int? fieldWithOnlyBothInitAndCtorInit = 123;
- A()
- : fieldWithOnlyCtorInit = null,
- fieldWithOnlyBothInitAndCtorInit = null;
+ A() : fieldWithOnlyCtorInit = null, fieldWithOnlyBothInitAndCtorInit = null;
}
main() {
diff --git a/tests/language/nnbd/syntax/late_modifier_runtime_error_test.dart b/tests/language/nnbd/syntax/late_modifier_runtime_error_test.dart
index d561457..281464a 100644
--- a/tests/language/nnbd/syntax/late_modifier_runtime_error_test.dart
+++ b/tests/language/nnbd/syntax/late_modifier_runtime_error_test.dart
@@ -38,34 +38,44 @@
main() {
// Static fields.
- Expect.throws(() => A.sf1,
- (e) => isValidError(e, "Field 'sf1' has not been initialized."));
- Expect.throws(() => A.sf2,
- (e) => isValidError(e, "Field 'sf2' has not been initialized."));
+ Expect.throws(
+ () => A.sf1,
+ (e) => isValidError(e, "Field 'sf1' has not been initialized."),
+ );
+ Expect.throws(
+ () => A.sf2,
+ (e) => isValidError(e, "Field 'sf2' has not been initialized."),
+ );
A.sf2 = 42;
Expect.throws(() {
A.sf2 = 2;
}, (e) => isValidError(e, "Field 'sf2' has already been initialized."));
Expect.throws(
- () => A.sf3,
- (e) => isValidError(
- e, "Field 'sf3' has been assigned during initialization."));
+ () => A.sf3,
+ (e) =>
+ isValidError(e, "Field 'sf3' has been assigned during initialization."),
+ );
// Instance fields.
A obj = A();
- Expect.throws(() => obj.f1,
- (e) => isValidError(e, "Field 'f1' has not been initialized."));
- Expect.throws(() => obj.f2,
- (e) => isValidError(e, "Field 'f2' has not been initialized."));
+ Expect.throws(
+ () => obj.f1,
+ (e) => isValidError(e, "Field 'f1' has not been initialized."),
+ );
+ Expect.throws(
+ () => obj.f2,
+ (e) => isValidError(e, "Field 'f2' has not been initialized."),
+ );
obj.f2 = 42;
Expect.throws(() {
obj.f2 = 2;
}, (e) => isValidError(e, "Field 'f2' has already been initialized."));
Expect.throws(
- () => obj.f3,
- (e) => isValidError(
- e, "Field 'f3' has been assigned during initialization."));
+ () => obj.f3,
+ (e) =>
+ isValidError(e, "Field 'f3' has been assigned during initialization."),
+ );
// Local variables.
late int local1;
@@ -89,10 +99,14 @@
local1 = -1;
}
- Expect.throws(() => local1,
- (e) => isValidError(e, "Local 'local1' has not been initialized."));
- Expect.throws(() => local2,
- (e) => isValidError(e, "Local 'local2' has not been initialized."));
+ Expect.throws(
+ () => local1,
+ (e) => isValidError(e, "Local 'local1' has not been initialized."),
+ );
+ Expect.throws(
+ () => local2,
+ (e) => isValidError(e, "Local 'local2' has not been initialized."),
+ );
// Assignment is conditional to avoid compile-time error "Late final variable
// 'local2' definitely assigned."
if (int.parse('1') == 1) {
@@ -102,7 +116,10 @@
local2 = 2;
}, (e) => isValidError(e, "Local 'local2' has already been initialized."));
Expect.throws(
- () => local3,
- (e) => isValidError(
- e, "Local 'local3' has been assigned during initialization."));
+ () => local3,
+ (e) => isValidError(
+ e,
+ "Local 'local3' has been assigned during initialization.",
+ ),
+ );
}
diff --git a/tests/language/nnbd/syntax/late_modifier_test.dart b/tests/language/nnbd/syntax/late_modifier_test.dart
index 3f2e3f0..5a11b3a 100644
--- a/tests/language/nnbd/syntax/late_modifier_test.dart
+++ b/tests/language/nnbd/syntax/late_modifier_test.dart
@@ -12,7 +12,9 @@
static int e_init() => 6;
late final int f;
- C() { f = 7; }
+ C() {
+ f = 7;
+ }
int get g {
late final int x;
diff --git a/tests/language/nnbd/syntax/non_null_assertion_test.dart b/tests/language/nnbd/syntax/non_null_assertion_test.dart
index 9d7a3e9..9a2806d 100644
--- a/tests/language/nnbd/syntax/non_null_assertion_test.dart
+++ b/tests/language/nnbd/syntax/non_null_assertion_test.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.
-
// Test that the trailing "!" is accepted after a sampling of expression
// syntaxes. Verify that the compiler understands the resulting type to be
// non-nullable by constructing a list containing the expression, and assigning
@@ -36,13 +35,19 @@
var x4 = [#foo!]; // ignore: unnecessary_non_null_assertion
listOfObject = x4;
- var x5 = [[1]!]; // ignore: unnecessary_non_null_assertion
+ var x5 = [
+ [1]!, // ignore: unnecessary_non_null_assertion
+ ];
listOfObject = x5;
- var x6 = [{1:2}!]; // ignore: unnecessary_non_null_assertion
+ var x6 = [
+ {1: 2}!, // ignore: unnecessary_non_null_assertion
+ ];
listOfObject = x6;
- var x7 = [{1}!]; // ignore: unnecessary_non_null_assertion
+ var x7 = [
+ {1}!, // ignore: unnecessary_non_null_assertion
+ ];
listOfObject = x7;
var x8 = [new C()!]; // ignore: unnecessary_non_null_assertion
@@ -52,20 +57,20 @@
listOfObject = x9;
Expect.throws(() {
- var x10 = [f()!];
- listOfObject = x10;
+ var x10 = [f()!];
+ listOfObject = x10;
});
C c = new C();
Expect.throws(() {
- var x11 = [c.x!];
- listOfObject = x11;
+ var x11 = [c.x!];
+ listOfObject = x11;
});
var g = f;
Expect.throws(() {
- var x12 = [g()!];
- listOfObject = x12;
+ var x12 = [g()!];
+ listOfObject = x12;
});
int i = 0;
diff --git a/tests/language/nnbd/syntax/null_assertion_ambiguous_test.dart b/tests/language/nnbd/syntax/null_assertion_ambiguous_test.dart
index 41aff1f..27d6d0c 100644
--- a/tests/language/nnbd/syntax/null_assertion_ambiguous_test.dart
+++ b/tests/language/nnbd/syntax/null_assertion_ambiguous_test.dart
@@ -6,8 +6,8 @@
import 'dart:async';
class C {
- C operator*(int? other) => this;
- Object? operator-() => null;
+ C operator *(int? other) => this;
+ Object? operator -() => null;
}
// Test ambiguous cases of trailing "!" syntax. Where possible, we verify that
@@ -18,10 +18,10 @@
// `throw a!` means `throw (a!)`, not `(throw a)!`. Since it's a compile-time
// error for a thrown expression to be potentially nullable, this is
// sufficient to verify that the compiler has resolved the ambiguity
- // correctly. We check the runtime behavior by verifying that an error is
+ // correctly. We check the runtime behavior by verifying that an error is
// thrown from the `a!`.
- Expect.throws(() {
- throw a!;
+ Expect.throws(() {
+ throw a!;
});
// `() => a!` means `() => (a!)`, not `(() => a)!`. We check the compile-time
@@ -31,7 +31,7 @@
var x1 = () => a!;
Object Function() x2 = x1;
Expect.throws(() {
- x1();
+ x1();
});
// `x = a!` means `x = (a!)`, not `(x = a)!`. We check the compile-time
@@ -40,11 +40,11 @@
// assignment occurs.
Object x3 = 0;
Expect.throws(() {
- x3 = a!;
+ x3 = a!;
});
var x4 = 0 as Object?;
Expect.throws(() {
- x4 = a!;
+ x4 = a!;
});
Expect.equals(x4, 0);
@@ -66,7 +66,7 @@
var x7 = new C();
i = null;
Expect.throws(() {
- x7 * i!;
+ x7 * i!;
});
// `-x!` means `-(x!)`, not `(-x)!`. We check the compile-time behavior by
diff --git a/tests/language/nnbd/syntax/nullable_type_ambiguous_test.dart b/tests/language/nnbd/syntax/nullable_type_ambiguous_test.dart
index 006bc4f..a6832d1 100644
--- a/tests/language/nnbd/syntax/nullable_type_ambiguous_test.dart
+++ b/tests/language/nnbd/syntax/nullable_type_ambiguous_test.dart
@@ -29,13 +29,13 @@
// { a is bool ? ? - 3 : 3 } is parsed as a set literal { (a is bool?) ? - 3 : 3 }.
a = true;
- var x4 = {a is bool ? ? -3 : 3};
+ var x4 = {a is bool? ? -3 : 3};
Expect.type<Set<dynamic>>(x4);
Set<dynamic> y4 = x4;
// { a is bool ?? true : 3 } is parsed as a map literal { ((a is bool) ?? true) : 3 }.
a = true;
- var x5 = {a is bool ?? true : 3};
+ var x5 = {a is bool ?? true: 3};
// ^^^^
// [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
Expect.type<Map<dynamic, dynamic>>(x5);
diff --git a/tests/language/nnbd/syntax/required_modifier_dynamic_error_test.dart b/tests/language/nnbd/syntax/required_modifier_dynamic_error_test.dart
index b9dee57..3b2b9bf 100644
--- a/tests/language/nnbd/syntax/required_modifier_dynamic_error_test.dart
+++ b/tests/language/nnbd/syntax/required_modifier_dynamic_error_test.dart
@@ -6,20 +6,22 @@
import 'package:expect/expect.dart';
class Foo {
- int foo(
- {required String a,
- required String b,
- required String c,
- required String d}) {
+ int foo({
+ required String a,
+ required String b,
+ required String c,
+ required String d,
+ }) {
return a.length + b.length + c.length + d.length;
}
}
-int baz(
- {required String a,
- required String b,
- required String c,
- required String d}) {
+int baz({
+ required String a,
+ required String b,
+ required String c,
+ required String d,
+}) {
return a.length + b.length + c.length + d.length;
}
@@ -33,11 +35,12 @@
dynamic tearOff = baz;
Expect.throwsNoSuchMethodError(() => tearOff(a: "aa", c: "cc", d: "dd"));
- dynamic closure = (
- {required String a,
- required String b,
- required String c,
- required String d}) {
+ dynamic closure = ({
+ required String a,
+ required String b,
+ required String c,
+ required String d,
+ }) {
return a.length + b.length + c.length + d.length;
};
Expect.throwsNoSuchMethodError(() => closure(a: "aa", c: "cc", d: "dd"));
diff --git a/tests/language/nnbd/top_merge/top_merge_interfaces_direct_error_test.dart b/tests/language/nnbd/top_merge/top_merge_interfaces_direct_error_test.dart
index 311fe6e..0380f5d 100644
--- a/tests/language/nnbd/top_merge/top_merge_interfaces_direct_error_test.dart
+++ b/tests/language/nnbd/top_merge/top_merge_interfaces_direct_error_test.dart
@@ -18,14 +18,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -33,14 +33,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -48,14 +48,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -63,14 +63,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -78,14 +78,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -93,14 +93,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -108,17 +108,20 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object?>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -135,14 +138,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -150,14 +153,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -165,14 +168,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -180,14 +183,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -195,14 +198,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -210,14 +213,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -225,17 +228,20 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object?>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -253,14 +259,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -269,14 +275,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -285,14 +291,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -301,14 +307,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -317,14 +323,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -333,14 +339,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -348,17 +354,20 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object? Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -378,14 +387,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -393,14 +402,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -408,14 +417,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -423,14 +432,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -438,14 +447,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -453,14 +462,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -468,17 +477,20 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object? Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
diff --git a/tests/language/nnbd/top_merge/top_merge_interfaces_mixin_error_test.dart b/tests/language/nnbd/top_merge/top_merge_interfaces_mixin_error_test.dart
index e7241c5..807f0ba 100644
--- a/tests/language/nnbd/top_merge/top_merge_interfaces_mixin_error_test.dart
+++ b/tests/language/nnbd/top_merge/top_merge_interfaces_mixin_error_test.dart
@@ -18,14 +18,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -33,14 +33,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -48,14 +48,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -63,14 +63,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -78,14 +78,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -93,14 +93,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -108,17 +108,20 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object?>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -135,14 +138,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -150,14 +153,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -165,14 +168,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -180,14 +183,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -195,14 +198,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -210,14 +213,14 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void>
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -225,17 +228,20 @@
void test() {
var x = deconstruct(this);
x.foo; // Check that we do not implement A<dynamic>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object?>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -252,14 +258,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -267,14 +273,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -282,14 +288,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -297,14 +303,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -312,14 +318,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -327,14 +333,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -342,17 +348,20 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object? Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -371,14 +380,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -386,14 +395,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -401,14 +410,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -416,14 +425,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -431,14 +440,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -446,14 +455,14 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that we do not implement A<void Function()>
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -461,17 +470,20 @@
void test() {
var x = deconstruct(this)();
x.foo; // Check that we do not implement A<dynamic Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that we do not implement A<Object? Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that we do not implement A<Object Function()>
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
diff --git a/tests/language/nnbd/top_merge/top_merge_members_direct_error_test.dart b/tests/language/nnbd/top_merge/top_merge_members_direct_error_test.dart
index 79beb98..7b6257a 100644
--- a/tests/language/nnbd/top_merge/top_merge_members_direct_error_test.dart
+++ b/tests/language/nnbd/top_merge/top_merge_members_direct_error_test.dart
@@ -25,14 +25,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -41,14 +41,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -57,14 +57,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -73,14 +73,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -89,14 +89,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -105,14 +105,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -121,17 +121,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return Object?
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -150,14 +153,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -166,14 +169,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -182,14 +185,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -198,14 +201,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -214,14 +217,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -230,14 +233,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -246,17 +249,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return dynamic
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return Object?
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return Object
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -276,14 +282,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -293,14 +299,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -310,14 +316,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -327,14 +333,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -344,14 +350,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -361,14 +367,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -377,17 +383,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return Object? Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -409,14 +418,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -425,14 +434,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -441,14 +450,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -457,14 +466,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -473,14 +482,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -489,14 +498,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return void Function()
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -505,17 +514,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return dynamic Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return Object? Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return Object Function()
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
diff --git a/tests/language/nnbd/top_merge/top_merge_members_mixin_error_test.dart b/tests/language/nnbd/top_merge/top_merge_members_mixin_error_test.dart
index 4be0ef7..71a66d9 100644
--- a/tests/language/nnbd/top_merge/top_merge_members_mixin_error_test.dart
+++ b/tests/language/nnbd/top_merge/top_merge_members_mixin_error_test.dart
@@ -27,14 +27,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -51,14 +51,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -67,17 +67,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -94,17 +97,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -113,17 +119,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -143,14 +152,14 @@
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -167,14 +176,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -183,17 +192,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -210,17 +222,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -229,17 +244,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -258,14 +276,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -282,14 +300,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -298,17 +316,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object? Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -325,17 +346,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object? Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -344,17 +368,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object? Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -380,14 +407,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<Object?>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<Object?>?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -396,14 +423,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<dynamic>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<dynamic>?' can't be assigned to the parameter type 'Object' because 'dynamic' is nullable and 'Object' isn't.
}
}
@@ -412,14 +439,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<Object?>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<Object?>?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -428,14 +455,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<void>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<void>?' can't be assigned to the parameter type 'Object' because 'void' is nullable and 'Object' isn't.
}
}
@@ -444,14 +471,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<dynamic>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<dynamic>?' can't be assigned to the parameter type 'Object' because 'dynamic' is nullable and 'Object' isn't.
}
}
@@ -460,14 +487,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<void>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<void>?' can't be assigned to the parameter type 'Object' because 'void' is nullable and 'Object' isn't.
}
}
@@ -476,14 +503,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<void>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<void>?' can't be assigned to the parameter type 'Object' because 'void' is nullable and 'Object' isn't.
}
}
@@ -492,13 +519,13 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<dynamic>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<dynamic>?' can't be assigned to the parameter type 'Object' because 'dynamic' is nullable and 'Object' isn't.
}
}
diff --git a/tests/language/nnbd/top_merge/top_merge_members_override_error_test.dart b/tests/language/nnbd/top_merge/top_merge_members_override_error_test.dart
index 85a5efb..27f1a98 100644
--- a/tests/language/nnbd/top_merge/top_merge_members_override_error_test.dart
+++ b/tests/language/nnbd/top_merge/top_merge_members_override_error_test.dart
@@ -25,14 +25,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -57,14 +57,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -77,17 +77,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -112,17 +115,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -135,17 +141,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -173,14 +182,14 @@
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -205,14 +214,14 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void`
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -225,17 +234,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -260,17 +272,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -283,17 +298,20 @@
var self = this;
var x = self.member();
x.foo; // Check that member does not return `dynamic`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object?`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -320,14 +338,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -352,14 +370,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'Object?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'Object?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -372,17 +390,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object? Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -407,17 +428,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object? Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -430,17 +454,20 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] The getter 'foo' isn't defined for the class 'void'.
x.toString; // Check that member does not return `Object? Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [error column 5]
+ // [cfe] This expression has type 'void' and can't be used.
+ //^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
+ // [cfe] This expression has type 'void' and can't be used.
}
}
@@ -474,14 +501,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<FutureOr<Object?>>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<FutureOr<Object?>>?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -494,14 +521,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<dynamic>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<dynamic>?' can't be assigned to the parameter type 'Object' because 'dynamic' is nullable and 'Object' isn't.
}
}
@@ -514,14 +541,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<Object?>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<Object?>?' can't be assigned to the parameter type 'Object' because 'Object?' is nullable and 'Object' isn't.
}
}
@@ -534,14 +561,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<void>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<void>?' can't be assigned to the parameter type 'Object' because 'void' is nullable and 'Object' isn't.
}
}
@@ -554,14 +581,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<dynamic>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<dynamic>?' can't be assigned to the parameter type 'Object' because 'dynamic' is nullable and 'Object' isn't.
}
}
@@ -574,14 +601,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<void>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<void>?' can't be assigned to the parameter type 'Object' because 'void' is nullable and 'Object' isn't.
}
}
@@ -594,14 +621,14 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<void>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<void>?' can't be assigned to the parameter type 'Object' because 'void' is nullable and 'Object' isn't.
}
}
@@ -614,13 +641,13 @@
var self = this;
var x = self.member()();
x.foo; // Check that member does not return `dynamic Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ //^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
+ // [cfe] The getter 'foo' isn't defined for the class 'FutureOr<dynamic>?'.
x.toString; // Check that member does not return `void Function()`
takesObject(x); // Check that member does not return `Object Function()`
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'FutureOr<dynamic>?' can't be assigned to the parameter type 'Object' because 'dynamic' is nullable and 'Object' isn't.
}
}
diff --git a/tests/language/nnbd/type_equality/function_type_equality_test.dart b/tests/language/nnbd/type_equality/function_type_equality_test.dart
index 16357eb..3ffb4a6 100644
--- a/tests/language/nnbd/type_equality/function_type_equality_test.dart
+++ b/tests/language/nnbd/type_equality/function_type_equality_test.dart
@@ -11,17 +11,25 @@
Expect.equals(fn.runtimeType, fn2.runtimeType);
Expect.equals(voidToInt.runtimeType, voidToInt2.runtimeType);
Expect.equals(voidToNullableInt.runtimeType, voidToNullableInt2.runtimeType);
- Expect.equals(positionalNullableIntToVoid.runtimeType,
- positionalNullableIntToVoid2.runtimeType);
+ Expect.equals(
+ positionalNullableIntToVoid.runtimeType,
+ positionalNullableIntToVoid2.runtimeType,
+ );
Expect.equals(optionalIntToVoid.runtimeType, optionalIntToVoid2.runtimeType);
- Expect.equals(optionalNullableIntToVoid.runtimeType,
- optionalNullableIntToVoid2.runtimeType);
+ Expect.equals(
+ optionalNullableIntToVoid.runtimeType,
+ optionalNullableIntToVoid2.runtimeType,
+ );
Expect.equals(namedIntToVoid.runtimeType, namedIntToVoid2.runtimeType);
Expect.equals(
- namedNullableIntToVoid.runtimeType, namedNullableIntToVoid2.runtimeType);
+ namedNullableIntToVoid.runtimeType,
+ namedNullableIntToVoid2.runtimeType,
+ );
Expect.equals(requiredIntToVoid.runtimeType, requiredIntToVoid2.runtimeType);
- Expect.equals(requiredNullableIntToVoid.runtimeType,
- requiredNullableIntToVoid2.runtimeType);
+ Expect.equals(
+ requiredNullableIntToVoid.runtimeType,
+ requiredNullableIntToVoid2.runtimeType,
+ );
// Required named arguments are not equal to named arguments.
Expect.notEquals(requiredIntToVoid.runtimeType, namedIntToVoid.runtimeType);
diff --git a/tests/language/nnbd/type_equality/futureOr_normalization_test.dart b/tests/language/nnbd/type_equality/futureOr_normalization_test.dart
index 0c0e3a0..0f0b4bd 100644
--- a/tests/language/nnbd/type_equality/futureOr_normalization_test.dart
+++ b/tests/language/nnbd/type_equality/futureOr_normalization_test.dart
@@ -32,15 +32,25 @@
Expect.equals(extractType<Embed<dynamic>>(), extractFutureOrType<dynamic>());
Expect.equals(extractType<Embed<Object>>(), extractFutureOrType<Object>());
Expect.equals(
- extractType<Embed<Object?>>(), embedNullableFutureOrType<Object>());
+ extractType<Embed<Object?>>(),
+ embedNullableFutureOrType<Object>(),
+ );
Expect.equals(extractType<Embed<Object?>>(), extractFutureOrType<Object?>());
Expect.equals(extractType<Embed<void>>(), extractFutureOrType<void>());
Expect.equals(
- extractType<Embed<Future<Never>>>(), extractFutureOrType<Never>());
+ extractType<Embed<Future<Never>>>(),
+ extractFutureOrType<Never>(),
+ );
Expect.equals(
- extractType<Embed<Future<Null>?>>(), extractFutureOrType<Null>());
+ extractType<Embed<Future<Null>?>>(),
+ extractFutureOrType<Null>(),
+ );
Expect.equals(
- extractType<Embed<FutureOr<int?>>>(), embedNullableFutureOrType<int?>());
+ extractType<Embed<FutureOr<int?>>>(),
+ embedNullableFutureOrType<int?>(),
+ );
Expect.equals(
- extractType<Embed<FutureOr<A?>>>(), embedNullableFutureOrType<A?>());
+ extractType<Embed<FutureOr<A?>>>(),
+ embedNullableFutureOrType<A?>(),
+ );
}
diff --git a/tests/language/nnbd/type_equality/generic_function_type_equality_test.dart b/tests/language/nnbd/type_equality/generic_function_type_equality_test.dart
index 22da2f8..b96ca05 100644
--- a/tests/language/nnbd/type_equality/generic_function_type_equality_test.dart
+++ b/tests/language/nnbd/type_equality/generic_function_type_equality_test.dart
@@ -12,20 +12,30 @@
Expect.equals(fn.runtimeType, fn2.runtimeType);
Expect.equals(voidToT.runtimeType, voidToS.runtimeType);
Expect.equals(positionalTToVoid.runtimeType, positionalSToVoid.runtimeType);
- Expect.equals(positionalNullableTToVoid.runtimeType,
- positionalNullableSToVoid.runtimeType);
+ Expect.equals(
+ positionalNullableTToVoid.runtimeType,
+ positionalNullableSToVoid.runtimeType,
+ );
Expect.equals(optionalTToVoid.runtimeType, optionalSToVoid.runtimeType);
Expect.equals(
- optionalNullableTToVoid.runtimeType, optionalNullableSToVoid.runtimeType);
+ optionalNullableTToVoid.runtimeType,
+ optionalNullableSToVoid.runtimeType,
+ );
Expect.equals(namedTToVoid.runtimeType, namedSToVoid.runtimeType);
Expect.equals(
- namedNullableTToVoid.runtimeType, namedNullableSToVoid.runtimeType);
+ namedNullableTToVoid.runtimeType,
+ namedNullableSToVoid.runtimeType,
+ );
Expect.equals(requiredTToVoid.runtimeType, requiredSToVoid.runtimeType);
Expect.equals(
- requiredNullableTToVoid.runtimeType, requiredNullableSToVoid.runtimeType);
+ requiredNullableTToVoid.runtimeType,
+ requiredNullableSToVoid.runtimeType,
+ );
// Required named arguments are not equal to named arguments.
Expect.notEquals(namedTToVoid.runtimeType, requiredTToVoid.runtimeType);
Expect.notEquals(
- namedNullableTToVoid.runtimeType, requiredNullableTToVoid.runtimeType);
+ namedNullableTToVoid.runtimeType,
+ requiredNullableTToVoid.runtimeType,
+ );
}
diff --git a/tests/language/nnbd/type_promotion/assignment_inference_after_null_check_test.dart b/tests/language/nnbd/type_promotion/assignment_inference_after_null_check_test.dart
index fbeb0be..9f034e1 100644
--- a/tests/language/nnbd/type_promotion/assignment_inference_after_null_check_test.dart
+++ b/tests/language/nnbd/type_promotion/assignment_inference_after_null_check_test.dart
@@ -7,7 +7,6 @@
// inference. This test makes sure that the type argument information is
// appropriately preserved.
-
void f(List<int>? x) {
if (x == null) {
// If x were promoted to `Null`, inference would not know that `[]` should
diff --git a/tests/language/nnbd/type_promotion/conditional_both_test.dart b/tests/language/nnbd/type_promotion/conditional_both_test.dart
index 65dccbc..26a72fa 100644
--- a/tests/language/nnbd/type_promotion/conditional_both_test.dart
+++ b/tests/language/nnbd/type_promotion/conditional_both_test.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.
-
void f(bool b, Object x) {
b ? ((x is String) || (throw 1)) : ((x is String) || (throw 2));
x.length;
diff --git a/tests/language/nnbd/type_promotion/do_outer_is_type_test.dart b/tests/language/nnbd/type_promotion/do_outer_is_type_test.dart
index 31c13e8..8d17883 100644
--- a/tests/language/nnbd/type_promotion/do_outer_is_type_test.dart
+++ b/tests/language/nnbd/type_promotion/do_outer_is_type_test.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.
-
void f(bool b, Object x) {
if (x is String) {
do {
diff --git a/tests/language/nnbd/type_promotion/for_outer_is_type_test.dart b/tests/language/nnbd/type_promotion/for_outer_is_type_test.dart
index 3226b28..92a055d 100644
--- a/tests/language/nnbd/type_promotion/for_outer_is_type_test.dart
+++ b/tests/language/nnbd/type_promotion/for_outer_is_type_test.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.
-
void f(bool b, Object x) {
if (x is String) {
for (; b;) {
diff --git a/tests/language/nnbd/type_promotion/function_expression_is_type_test.dart b/tests/language/nnbd/type_promotion/function_expression_is_type_test.dart
index 8209961..b83c7fe 100644
--- a/tests/language/nnbd/type_promotion/function_expression_is_type_test.dart
+++ b/tests/language/nnbd/type_promotion/function_expression_is_type_test.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.
-
void f() {
void g(Object x) {
if (x is String) {
diff --git a/tests/language/nnbd/type_promotion/logical_or_throw_test.dart b/tests/language/nnbd/type_promotion/logical_or_throw_test.dart
index 55dbc0b..c0ef68b 100644
--- a/tests/language/nnbd/type_promotion/logical_or_throw_test.dart
+++ b/tests/language/nnbd/type_promotion/logical_or_throw_test.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.
-
void f(Object x) {
x is String || (throw 42);
x.length;
diff --git a/tests/language/nnbd/type_promotion/null_type_insufficient_for_equals_null_check_error_test.dart b/tests/language/nnbd/type_promotion/null_type_insufficient_for_equals_null_check_error_test.dart
index bc800dc..af0228d 100644
--- a/tests/language/nnbd/type_promotion/null_type_insufficient_for_equals_null_check_error_test.dart
+++ b/tests/language/nnbd/type_promotion/null_type_insufficient_for_equals_null_check_error_test.dart
@@ -8,13 +8,11 @@
// expression `(x = null)`). This test demonstrates the problem with `(x =
// null)` and checks a few other cases.
-
void assignNullRhs(int? x) {
if (x != (x = null)) {
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
- //^
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
@@ -25,9 +23,8 @@
// promote in order to be consistent with the `assignNullRhs` case.
if ((x = null) != x) {
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
- //^
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
@@ -35,9 +32,8 @@
void unrelatedVarRhs(int? x, Null n) {
if (x != n) {
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
- //^
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
@@ -45,9 +41,8 @@
void unrelatedVarLhs(int? x, Null n) {
if (n != x) {
x.isEven;
-// ^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
- //^
+ //^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
diff --git a/tests/language/nnbd/type_promotion/promoted_lhs_used_as_assignment_context_test.dart b/tests/language/nnbd/type_promotion/promoted_lhs_used_as_assignment_context_test.dart
index 149afdd..a438f8c 100644
--- a/tests/language/nnbd/type_promotion/promoted_lhs_used_as_assignment_context_test.dart
+++ b/tests/language/nnbd/type_promotion/promoted_lhs_used_as_assignment_context_test.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.
-
import 'package:expect/expect.dart';
void f(Object x) {
diff --git a/tests/language/nnbd/type_promotion/try_catch_catch_finally_outer_is_type_test.dart b/tests/language/nnbd/type_promotion/try_catch_catch_finally_outer_is_type_test.dart
index 5e0bb57..c9bfbf9 100644
--- a/tests/language/nnbd/type_promotion/try_catch_catch_finally_outer_is_type_test.dart
+++ b/tests/language/nnbd/type_promotion/try_catch_catch_finally_outer_is_type_test.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.
-
void f(Object x) {
if (x is String) {
try {
diff --git a/tests/language/nnbd/type_promotion/try_catch_is_not_type_exit_body_catch_test.dart b/tests/language/nnbd/type_promotion/try_catch_is_not_type_exit_body_catch_test.dart
index af75aaf..8f8bba1 100644
--- a/tests/language/nnbd/type_promotion/try_catch_is_not_type_exit_body_catch_test.dart
+++ b/tests/language/nnbd/type_promotion/try_catch_is_not_type_exit_body_catch_test.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.
-
void f(Object x) {
try {
if (x is! String) return;
diff --git a/tests/language/no_such_method/megamorphic_test.dart b/tests/language/no_such_method/megamorphic_test.dart
index bbae61a..f4de85c 100644
--- a/tests/language/no_such_method/megamorphic_test.dart
+++ b/tests/language/no_such_method/megamorphic_test.dart
@@ -66,7 +66,7 @@
new A6(),
new A7(),
new A8(),
- new A9()
+ new A9(),
];
for (int i = 0; i < 20; i++) {
for (var obj in list) {
diff --git a/tests/language/no_such_method/mock_test.dart b/tests/language/no_such_method/mock_test.dart
index c6af6b4..64249bd 100644
--- a/tests/language/no_such_method/mock_test.dart
+++ b/tests/language/no_such_method/mock_test.dart
@@ -138,8 +138,10 @@
Expect.isTrue(eat is EatFoodType, 'eat is EatFoodType');
Expect.isTrue(eat2 is EatFoodType, 'eat2 is EatFoodType');
Expect.equals(eat, eat2, 'eat == eat2');
- Expect.isTrue(eat.runtimeType == eat2.runtimeType,
- 'eat.runtimeType == eat2.runtimeType');
+ Expect.isTrue(
+ eat.runtimeType == eat2.runtimeType,
+ 'eat.runtimeType == eat2.runtimeType',
+ );
Expect.isTrue(eat("cat food"), 'eat("cat food")');
Expect.isFalse(eat(""), 'eat("")');
@@ -151,8 +153,11 @@
var doStuff2 = (g as dynamic).doStuff;
Expect.equals(doStuff, doStuff2, 'doStuff == doStuff2');
- Expect.equals(doStuff.runtimeType, doStuff2.runtimeType,
- 'doStuff.runtimeType == doStuff2.runtimeType');
+ Expect.equals(
+ doStuff.runtimeType,
+ doStuff2.runtimeType,
+ 'doStuff.runtimeType == doStuff2.runtimeType',
+ );
Expect.listEquals([int], doStuff(42));
Expect.listEquals([num], doStuff<num>(42));
diff --git a/tests/language/no_such_method/simple_type_arguments_test.dart b/tests/language/no_such_method/simple_type_arguments_test.dart
index 7375f4a..51da77d 100644
--- a/tests/language/no_such_method/simple_type_arguments_test.dart
+++ b/tests/language/no_such_method/simple_type_arguments_test.dart
@@ -15,8 +15,10 @@
void main() {
var g = new Mock();
- Expect.listEquals(
- [String, int], (g as dynamic).hurrah<String, int>(moose: 42, duck: 12));
+ Expect.listEquals([
+ String,
+ int,
+ ], (g as dynamic).hurrah<String, int>(moose: 42, duck: 12));
// map has interceptor calling convention in dart2js.
Expect.listEquals([String, int], (g as dynamic).map<String, int>());
diff --git a/tests/language/nonfunction_type_aliases/aliased_cyclic_superclass_error_test.dart b/tests/language/nonfunction_type_aliases/aliased_cyclic_superclass_error_test.dart
index ad68b50..cd10ff2 100644
--- a/tests/language/nonfunction_type_aliases/aliased_cyclic_superclass_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/aliased_cyclic_superclass_error_test.dart
@@ -2,12 +2,11 @@
// 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.
-
typedef T = C;
class C extends T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
+// [cfe] 'C' is a supertype of itself.
main() => C();
diff --git a/tests/language/nonfunction_type_aliases/cyclic_bound_error_test.dart b/tests/language/nonfunction_type_aliases/cyclic_bound_error_test.dart
index f9432b2..7d1714b 100644
--- a/tests/language/nonfunction_type_aliases/cyclic_bound_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/cyclic_bound_error_test.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.
-
// This test verifies that cyclic type alias definitions cause a compile-time
// error, when the cycle occurs via the bound.
@@ -59,7 +58,8 @@
// Note: we have to use `void Function<...>() Function()` because a generic
// function can't directly be used as a bound.
-typedef T12<X extends void Function<Y extends T12<Never>>() Function()> = List<X>;
-// ^^^
-// [analyzer] COMPILE_TIME_ERROR.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
-// [cfe] The typedef 'T12' has a reference to itself.
+typedef T12<X extends void Function<Y extends T12<Never>>() Function()> =
+ // ^^^
+ // [analyzer] COMPILE_TIME_ERROR.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
+ // [cfe] The typedef 'T12' has a reference to itself.
+ List<X>;
diff --git a/tests/language/nonfunction_type_aliases/cyclic_bound_unused_error_test.dart b/tests/language/nonfunction_type_aliases/cyclic_bound_unused_error_test.dart
index 735b88a..7abf690 100644
--- a/tests/language/nonfunction_type_aliases/cyclic_bound_unused_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/cyclic_bound_unused_error_test.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.
-
// This test verifies that cyclic type alias definitions cause a compile-time
// error, when the cycle occurs via the bound, even if the bound variable is not
// used in the expansion.
diff --git a/tests/language/nonfunction_type_aliases/cyclic_expansion_error_test.dart b/tests/language/nonfunction_type_aliases/cyclic_expansion_error_test.dart
index 8265153..958a9ad 100644
--- a/tests/language/nonfunction_type_aliases/cyclic_expansion_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/cyclic_expansion_error_test.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.
-
// This test verifies that cyclic type alias definitions cause a compile-time
// error, when the cycle occurs via the expansion of the type.
diff --git a/tests/language/nonfunction_type_aliases/generic_aliased_supertype_test.dart b/tests/language/nonfunction_type_aliases/generic_aliased_supertype_test.dart
index 7d4741f..3a45697 100644
--- a/tests/language/nonfunction_type_aliases/generic_aliased_supertype_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_aliased_supertype_test.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.
-
class A<X> {}
typedef A1<Y> = A<Y>;
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_class_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_class_error_test.dart
index 2bfe9dd..9de7477 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_class_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_class_error_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -21,17 +20,21 @@
abstract class D2 extends C with T<int> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [cfe] Can't use 'A' as a mixin because it has constructors.
+// ^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
+// [cfe] The class 'A' can't be used as a mixin because it isn't a mixin class nor a mixin.
abstract class D4 = C with T<void>;
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [cfe] Can't use 'A' as a mixin because it has constructors.
+// ^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
+// [cfe] The class 'A' can't be used as a mixin because it isn't a mixin class nor a mixin.
main() {
T<List<List<List<List>>>>.staticMethod<T<int>>();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] Cannot access static member on an instantiated generic class.
}
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_class_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_class_test.dart
index af2d2d8..034b45b 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_class_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_class_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -33,7 +32,7 @@
List<T<T>> v6 = [];
final T<Null> v7;
- C(): v7 = T<Null>();
+ C() : v7 = T<Null>();
C.name1(this.v5, this.v7);
factory C.name2(T<C> arg1, T<Null> arg2) = C1.name1;
@@ -50,6 +49,7 @@
}
class D1<X> extends T<X> {}
+
abstract class D3<X, Y> implements T<T> {}
extension E on T<dynamic> {
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_dynamic_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_dynamic_error_test.dart
index 3e46f98..dbc53ef 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_dynamic_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_dynamic_error_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -14,31 +13,35 @@
abstract class C {
final T<Null> v7;
- C(): v7 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v7 = T();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
}
class D1<X> extends T<X> {}
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS
+// [cfe] The type 'T<X>' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
abstract class D2 extends C with T<int> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [cfe] The type 'T<int>' can't be mixed in.
+// ^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T<int>' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
abstract class D3<X, Y> implements T<T> {}
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS
+// [cfe] The type 'T<T>' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
abstract class D4 = C with T<void>;
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [cfe] The type 'T<void>' can't be mixed in.
+// ^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T<void>' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
X foo<X>(X x) => x;
@@ -46,26 +49,27 @@
var v9 = <Set<T<T>>, Set<T<T>>>{{}: {}};
v9[{}] = {T<T>()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T<Null>();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T<Null>.named();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
+ // ^
+ // [cfe] Couldn't find constructor 'T.named'.
T<Object> v12 = foo<T<bool>>(T<bool>());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T<List<List<List<List>>>>.staticMethod<T<int>>();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // ^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'staticMethod' isn't defined for the class 'Type'.
}
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_dynamic_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_dynamic_test.dart
index f157907..8597655 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_dynamic_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_dynamic_test.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.
-
import 'dart:async';
// Introduce an aliased type.
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart
index 1895e01..dd000bf 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart
@@ -14,57 +14,60 @@
final T<Null> v7;
C() : v7 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
}
class D1<X> extends T<X> {}
// ^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
+// [cfe] The class 'Function' can't be extended outside of its library because it's a final class.
abstract class D2 extends C with T<int> {}
+// ^
+// [cfe] The type 'D2' must be 'base', 'final' or 'sealed' because the supertype 'Function' is 'final'.
// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
+// [cfe] The class 'Function' can't be used as a mixin because it isn't a mixin class nor a mixin.
abstract class D3<X, Y> implements T<T> {}
// ^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
+// [cfe] The class 'Function' can't be implemented outside of its library because it's a final class.
abstract class D4 = C with T<void>;
// ^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
+// [cfe] The class 'Function' can't be used as a mixin because it isn't a mixin class nor a mixin.
X foo<X>(X x) => x;
main() {
var v9 = <Set<T<T>>, Set<T<T>>>{{}: {}};
v9[{}] = {T<T>()};
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
T<Null>();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 7]
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
T<Null>.named();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // ^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR
+ // [cfe] Couldn't find constructor 'T.named'.
T<Object> v12 = foo<T<bool>>(T<bool>());
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
T<List<List<List<List>>>>.staticMethod<T<int>>();
// ^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] A constructor invocation can't have type arguments after the constructor name.
+ // [cfe] Member not found: 'Function.staticMethod'.
}
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_futureor_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_futureor_error_test.dart
index e6c0f4a..8a3dec8 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_futureor_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_futureor_error_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -14,59 +13,69 @@
abstract class C {
final T<Null> v7;
- C(): v7 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v7 = T();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // ^^^
+ // [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
+ // [cfe] Couldn't find constructor 'T'.
}
class D1<X> extends T<X> {}
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [cfe] The superclass, 'FutureOr', has no unnamed constructor that takes no arguments.
+// ^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
abstract class D2 extends C with T<int> {}
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [cfe] Can't use 'FutureOr' as a mixin because it has constructors.
+// ^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+// [cfe] The class 'FutureOr' can't be used as a mixin because it isn't a mixin class nor a mixin.
+// [cfe] The type 'T<int>' which is an alias of 'FutureOr<int>' can't be used as supertype.
abstract class D3<X, Y> implements T<T> {}
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [cfe] The type 'FutureOr' can't be used in an 'implements' clause.
+// ^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
abstract class D4 = C with T<void>;
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [cfe] Can't use 'FutureOr' as a mixin because it has constructors.
+// ^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+// [cfe] The class 'FutureOr' can't be used as a mixin because it isn't a mixin class nor a mixin.
+// [cfe] The type 'T<void>' which is an alias of 'FutureOr<void>' can't be used as supertype because it is nullable.
X foo<X>(X x) => x;
main() {
var v9 = <Set<T<T>>, Set<T<T>>>{{}: {}};
v9[{}] = {T<T>()};
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // [cfe] Couldn't find constructor 'T'.
T<Null>();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 7]
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // [cfe] Couldn't find constructor 'T'.
T<Null>.named();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
-
+ // ^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR
+ // [cfe] Couldn't find constructor 'T.named'.
T<Object> v12 = foo<T<bool>>(T<bool>());
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // [cfe] Couldn't find constructor 'T'.
T<List<List<List<List>>>>.staticMethod<T<int>>();
// ^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] A constructor invocation can't have type arguments after the constructor name.
+ // [cfe] Member not found: 'FutureOr.staticMethod'.
}
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_futureor_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_futureor_test.dart
index b0e7a35..c94e8cab 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_futureor_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_futureor_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -27,7 +26,7 @@
List<T<T>> v6 = [];
final T<Null> v7;
- C(): v7 = null;
+ C() : v7 = null;
C.name1(this.v5, this.v7);
factory C.name2(T<C> arg1, T<Null> arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_null_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_null_test.dart
index 01f4644..bb1b9ff 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_null_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_null_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -27,7 +26,7 @@
List<T<T>> v6 = [];
final T<Null> v7;
- C(): v7 = null;
+ C() : v7 = null;
C.name1(this.v5, this.v7);
factory C.name2(T<C> arg1, T<Null> arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_object_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_object_error_test.dart
index 3fa925f..6aaf1d1 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_object_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_object_error_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -14,23 +13,28 @@
abstract class C {}
abstract class D2 extends C with T<int> {}
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [cfe] Can't use 'Object' as a mixin because it has constructors.
+// ^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
+// [cfe] The class 'Object' can't be used as a mixin because it isn't a mixin class nor a mixin.
abstract class D4 = C with T<void>;
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [cfe] Can't use 'Object' as a mixin because it has constructors.
+// ^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
+// [cfe] The class 'Object' can't be used as a mixin because it isn't a mixin class nor a mixin.
main() {
T<Null>.named();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR
+ // [cfe] Couldn't find constructor 'T.named'.
T<List<List<List<List>>>>.staticMethod<T<int>>();
// ^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] A constructor invocation can't have type arguments after the constructor name.
+ // [cfe] Member not found: 'Object.staticMethod'.
}
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_object_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_object_test.dart
index 053c634..f493aec 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_object_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_object_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -27,7 +26,7 @@
List<T<T>> v11 = [];
final T<Null> v12;
- C(): v12 = T();
+ C() : v12 = T();
C.name1(this.v10, this.v12);
factory C.name2(T<C> arg1, T<Null> arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_type_variable_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_type_variable_error_test.dart
index 46f8b2a..2b0cc7b 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_type_variable_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_type_variable_error_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -14,54 +13,69 @@
abstract class C {
final T<Map> v7;
- C(): v7 = T<Map>();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v7 = T<Map>();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
}
class D {}
+
mixin M {}
abstract class D1<X> extends T<D> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
abstract class D2 extends C with T<M> {}
+// ^
+// [cfe] The type 'T<M>' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
abstract class D3<X, Y> implements T<T<D>> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
abstract class D4 = C with T<D>;
+// ^
+// [cfe] The type 'T<D>' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
class D5<X> extends T<X> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// [cfe] The type 'T<X>' which is an alias of 'X' can't be used as supertype.
abstract class D6 extends C with T<int> {}
+// ^
+// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
+// [cfe] The type 'T<int>' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// [cfe] The class 'int' can't be used as a mixin because it extends a class other than 'Object'.
abstract class D7<X, Y> implements T<T> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// [cfe] The type 'T<T>' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
abstract class D8 = C with T<void>;
+// ^
+// [cfe] The type 'T<void>' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// [cfe] The type 'T<void>' which is an alias of 'void' can't be used as supertype because it is nullable.
X foo<X>(X x) => x;
@@ -69,36 +83,49 @@
var v9 = <Set<T<T>>, Set<T<T>>>{{}: {}};
v9[{}] = {T<C>()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T<Null>();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T<Null>.named();
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [cfe] Couldn't find constructor 'T.named'.
T<Object> v12 = foo<T<bool>>(T<bool>());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T<List<List<List<List>>>>.staticMethod<T<int>>();
+ // [error column 3]
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
// ^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'staticMethod' isn't defined for the class 'Type'.
T<Object>();
-//^^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T<C>.name1(C(), null);
-//^^^^^^^^^^^^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // ^
+ // [cfe] Couldn't find constructor 'T.name1'.
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'C' is abstract and can't be instantiated.
}
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_type_variable_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_type_variable_test.dart
index 49702e0..cfeb162 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_type_variable_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_type_variable_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -27,7 +26,7 @@
List<T<T>> v6 = [];
final T<Null> v7;
- C(): v7 = null;
+ C() : v7 = null;
C.name1(this.v5, this.v7);
factory C.name2(T<D> arg1, T<Null> arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_void_error_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_void_error_test.dart
index a580157..4e3295f 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_void_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_void_error_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -14,31 +13,35 @@
abstract class C {
final T<Null> v7;
- C(): v7 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v7 = T();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
}
class D1<X> extends T<X> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS
+// [cfe] The type 'T<X>' which is an alias of 'void' can't be used as supertype because it is nullable.
abstract class D2 extends C with T<int> {}
+// ^
+// [cfe] The type 'T<int>' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T<int>' which is an alias of 'void' can't be used as supertype because it is nullable.
abstract class D3<X, Y> implements T<T> {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS
+// [cfe] The type 'T<T>' which is an alias of 'void' can't be used as supertype because it is nullable.
abstract class D4 = C with T<void>;
+// ^
+// [cfe] The type 'T<void>' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T<void>' which is an alias of 'void' can't be used as supertype because it is nullable.
extension E on T<dynamic> {
T<dynamic> foo(T<dynamic> t) => t;
@@ -52,29 +55,30 @@
var v10 = {v8};
v9[{}] = {T<T>()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
Set<List<T<C>>> v11 = v10;
v10 = v11;
T<Null>();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T<Null>.named();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
+ // ^
+ // [cfe] Couldn't find constructor 'T.named'.
T<Object> v12 = foo<T<bool>>(T<bool>());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T<List<List<List<List>>>>.staticMethod<T<int>>();
// ^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'staticMethod' isn't defined for the class 'Type'.
}
diff --git a/tests/language/nonfunction_type_aliases/generic_usage_void_test.dart b/tests/language/nonfunction_type_aliases/generic_usage_void_test.dart
index 62f79ec..7dfecdb 100644
--- a/tests/language/nonfunction_type_aliases/generic_usage_void_test.dart
+++ b/tests/language/nonfunction_type_aliases/generic_usage_void_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -27,7 +26,7 @@
List<T<T>> v6 = [];
final T<Null> v7;
- C(): v7 = null;
+ C() : v7 = null;
C.name1(this.v5, this.v7);
factory C.name2(T<C> arg1, T<Null> arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_01_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_01_test.dart
index e62c64d..197d871 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_01_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_01_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_02_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_02_test.dart
index cdc8912..e193bd0 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_02_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_02_test.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.
-
import 'package:expect/expect.dart';
class C {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_03_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_03_test.dart
index e926626..9600838 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_03_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_03_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_04_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_04_test.dart
index 65e3a87..7554213 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_04_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_04_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_05_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_05_test.dart
index f47987c..55a806c 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_05_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_05_test.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.
-
import 'package:expect/expect.dart';
class C<X, Y> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_06_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_06_test.dart
index b9daec0..bdb948d 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_06_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_06_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_07_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_07_test.dart
index d3e86d0..df6e48a 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_07_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_07_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_08_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_08_test.dart
index 61ba91e..ca5602a 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_08_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_08_test.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.
-
import 'package:expect/expect.dart';
class C<X extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_09_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_09_test.dart
index a94ddc5..4bcf315 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_09_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_09_test.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.
-
import 'package:expect/expect.dart';
class C {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_10_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_10_test.dart
index 7b8dcbf..236aed4 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_10_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_10_test.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.
-
import 'package:expect/expect.dart';
class C<X extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_11_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_11_test.dart
index fa855f1..cc9f227 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_11_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_11_test.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.
-
import 'package:expect/expect.dart';
class C<X extends Iterable<num>> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_12_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_12_test.dart
index 3330ad0..e7db4bc 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_12_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_factory_invocation_12_test.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.
-
import 'package:expect/expect.dart';
class C<X extends String, Y extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_01_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_01_test.dart
index 098b885..78d887c 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_01_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_01_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_02_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_02_test.dart
index 944f607..56ed13b 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_02_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_02_test.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.
-
import 'package:expect/expect.dart';
class C {}
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_03_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_03_test.dart
index de472c8..205180c 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_03_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_03_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_04_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_04_test.dart
index dcea863..d01d2ff 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_04_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_04_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_05_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_05_test.dart
index 51a7e74..f601391 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_05_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_05_test.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.
-
import 'package:expect/expect.dart';
class C<X, Y> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_06_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_06_test.dart
index 4db9e2b..312d859 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_06_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_06_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_07_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_07_test.dart
index de798cc..6630370 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_07_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_07_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_08_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_08_test.dart
index 580fb24..8bf8c5e 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_08_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_08_test.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.
-
import 'package:expect/expect.dart';
class C<X extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_09_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_09_test.dart
index f1c7cfed..37240b5 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_09_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_09_test.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.
-
import 'package:expect/expect.dart';
class C {}
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_10_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_10_test.dart
index 2a1254f..dfa9cf6 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_10_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_10_test.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.
-
import 'package:expect/expect.dart';
class C<X extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_11_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_11_test.dart
index a2c8d23..b3591589 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_11_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_11_test.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.
-
import 'package:expect/expect.dart';
class C<X extends Iterable<num>> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_12_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_12_test.dart
index 248c08a..0308689 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_12_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_instance_creation_12_test.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.
-
import 'package:expect/expect.dart';
class C<X extends String, Y extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_01_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_01_test.dart
index 5a83a94..72309c0 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_01_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_01_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_02_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_02_test.dart
index 48ddd06..c6036f4 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_02_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_02_test.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.
-
import 'package:expect/expect.dart';
class C {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_03_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_03_test.dart
index e978165..5e2c7b4 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_03_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_03_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_04_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_04_test.dart
index 8b94ddb..33f87ab 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_04_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_04_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_05_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_05_test.dart
index 78423b6..c09f8cf 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_05_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_05_test.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.
-
import 'package:expect/expect.dart';
class C<X, Y> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_06_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_06_test.dart
index 4629bd0..c2fe5af 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_06_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_06_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_07_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_07_test.dart
index 05b4e03..53e200c 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_07_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_07_test.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.
-
import 'package:expect/expect.dart';
class C<X> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_08_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_08_test.dart
index e51761e..46e18af 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_08_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_08_test.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.
-
import 'package:expect/expect.dart';
class C<X extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_09_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_09_test.dart
index b121ef9..a91bd9c 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_09_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_09_test.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.
-
import 'package:expect/expect.dart';
class C {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_10_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_10_test.dart
index eba59a6..8e78116 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_10_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_10_test.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.
-
import 'package:expect/expect.dart';
class C<X extends num> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_11_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_11_test.dart
index 70ede40..c1adc4f 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_11_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_11_test.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.
-
import 'package:expect/expect.dart';
class C<X extends Iterable<num>> {
diff --git a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_12_test.dart b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_12_test.dart
index fefa6ff..0a094bb 100644
--- a/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_12_test.dart
+++ b/tests/language/nonfunction_type_aliases/infer_aliased_redirecting_factory_invocation_12_test.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.
-
import 'package:expect/expect.dart';
class C<X extends String, Y extends num> {
diff --git a/tests/language/nonfunction_type_aliases/near_expand_to_type_variable_test.dart b/tests/language/nonfunction_type_aliases/near_expand_to_type_variable_test.dart
index 4ef5b9e..fb1779d 100644
--- a/tests/language/nonfunction_type_aliases/near_expand_to_type_variable_test.dart
+++ b/tests/language/nonfunction_type_aliases/near_expand_to_type_variable_test.dart
@@ -2,13 +2,12 @@
// 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.
-
import 'package:expect/expect.dart';
typedef TB<T extends C> = T;
-typedef AC = C; // Direct.
-typedef AEC = TB<C>; // Explicit C argument.
-typedef AIC = TB; // Implicit instantiate to bounds.
+typedef AC = C; // Direct.
+typedef AEC = TB<C>; // Explicit C argument.
+typedef AIC = TB; // Implicit instantiate to bounds.
class C {
static const c = 42;
diff --git a/tests/language/nonfunction_type_aliases/nnbd_syntax_test.dart b/tests/language/nonfunction_type_aliases/nnbd_syntax_test.dart
index 4463ca9..0d23801 100644
--- a/tests/language/nonfunction_type_aliases/nnbd_syntax_test.dart
+++ b/tests/language/nonfunction_type_aliases/nnbd_syntax_test.dart
@@ -7,8 +7,8 @@
typedef T2<X, Y> = Map<X?, Y?>?;
typedef T3 = Never? Function(void)?;
typedef T4<X> = X? Function(X?, {required X? name})?;
-typedef T5<X extends String, Y extends List<X?>> = X? Function(Y?,
- [Map<Y, Y?>]);
+typedef T5<X extends String, Y extends List<X?>> =
+ X? Function(Y?, [Map<Y, Y?>]);
void main() {
// ignore:unused_local_variable
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_cast_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_cast_test.dart
index 259da2d..284c73e 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_cast_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_cast_test.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.
-
// Test that private names exported via public typedefs can be used for casts
import "package:expect/expect.dart";
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_creation_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_creation_test.dart
index f0655a3..ddd4b34 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_creation_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_creation_test.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.
-
// Test that private names exported via public typedefs allow creation.
import "package:expect/expect.dart";
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_duplicate_interface_error_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_duplicate_interface_error_test.dart
index 04fe02b..dd7ebb9 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_duplicate_interface_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_duplicate_interface_error_test.dart
@@ -10,27 +10,27 @@
/// Test that having a private class in the implements and extends class via two
/// different public names is an error.
class A0 extends PublicClass implements AlsoPublicClass {
-// ^
-// [cfe] '_PrivateClass' can't be used in both 'extends' and 'implements' clauses.
-// ^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_SUPER_CLASS
+ // ^
+ // [cfe] '_PrivateClass' can't be used in both 'extends' and 'implements' clauses.
+ // ^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_SUPER_CLASS
}
/// Test that having a private class in the implements class twice via the same
/// public name is an error.
class A1 implements PublicClass, PublicClass {
-// ^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_REPEATED
-// [cfe] unspecified
+ // ^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_REPEATED
+ // [cfe] '_PrivateClass' can only be implemented once.
noSuchMethod(_) => null;
}
/// Test that having a private class in the implements class twice via two
/// different public names is an error.
class A2 implements PublicClass, AlsoPublicClass {
-// ^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_REPEATED
-// [cfe] unspecified
+ // ^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_REPEATED
+ // [cfe] '_PrivateClass' can only be implemented once.
noSuchMethod(_) => null;
}
@@ -40,10 +40,9 @@
/// Test that having a private generic class in the super-interface graph
/// twice with two different generic instantiations is an error.
class A4 extends A3 implements PublicGenericClass<String> {
-// [error line 42, column 7, length 2]
-// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
-// ^
-// [cfe] 'A4' can't implement both '_PrivateGenericClass<int>' and '_PrivateGenericClass<String>'
+ // ^^
+ // [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
+ // [cfe] 'A4' can't implement both '_PrivateGenericClass<int>' and '_PrivateGenericClass<String>'
}
/// Test that having a private generic class in the super-interface graph
@@ -53,12 +52,12 @@
/// Test that having a private generic class in the implements clause twice with
/// two different generic instantiations is an error.
class A6 implements PublicGenericClass<int>, PublicGenericClass<String> {
-// [error line 55, column 7, length 2]
-// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
-// ^
-// [cfe] 'A6' can't implement both '_PrivateGenericClass<int>' and '_PrivateGenericClass<String>'
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_REPEATED
+ // ^^
+ // [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
+ // [cfe] 'A6' can't implement both '_PrivateGenericClass<int>' and '_PrivateGenericClass<String>'
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_REPEATED
+ // [cfe] '_PrivateGenericClass' can only be implemented once.
}
void main() {}
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_extension_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_extension_test.dart
index 61d1d3f..0f0bd32 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_extension_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_extension_test.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.
-
// Test that private names exported via public typedefs allow extension.
import "package:expect/expect.dart";
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_instance_checks_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_instance_checks_test.dart
index 6e8141d..ddfaeff 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_instance_checks_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_instance_checks_test.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.
-
// Test that private names exported via public typedefs can be used for instance
// checks
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_library.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_library.dart
index 9f34b2f..92232b5 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_library.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_library.dart
@@ -49,7 +49,8 @@
// Helper methods to do virtual calls on instances of _PrivateClass in this
// library context.
-int callPrivateInstanceMethod(_PrivateClass other) => other._privateInstanceMethod();
+int callPrivateInstanceMethod(_PrivateClass other) =>
+ other._privateInstanceMethod();
int callInstanceMethod(_PrivateClass other) => other.instanceMethod();
int readInstanceField(_PrivateClass other) => other.x;
@@ -74,7 +75,7 @@
// Call the private SuperMixinMethod
int callPrivateSuperMixinMethod(_PrivateSuperMixin other) =>
-other._privateMixinMethod();
+ other._privateMixinMethod();
// Export the private super-mixin.
typedef PublicSuperMixin = _PrivateSuperMixin;
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_error_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_error_test.dart
index 5520229..688be74 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_error_test.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.
-
// Test that a private mixin exported via a typedef cannot be used as a class.
import "private_name_library.dart";
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_test.dart
index 39e9f8c..aea9556 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_mixin_test.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.
-
// Test that private names exported via public typedefs can be used as mixins.
import "package:expect/expect.dart";
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_error_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_error_test.dart
index 8a10020..0f6e7f7 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_error_test.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.
-
// Test that private names exported via public typedefs don't give access to
// private static methods.
@@ -12,17 +11,17 @@
void test1() {
{
PublicClass._privateStaticMethod();
-// ^^^^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
-// [cfe] Member not found: '_PrivateClass._privateStaticMethod'.
+ // ^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] Member not found: '_PrivateClass._privateStaticMethod'.
AlsoPublicClass._privateStaticMethod();
-// ^^^^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
-// [cfe] Member not found: '_PrivateClass._privateStaticMethod'.
+ // ^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] Member not found: '_PrivateClass._privateStaticMethod'.
PublicGenericClassOfInt._privateStaticMethod();
-// ^^^^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
-// [cfe] Member not found: '_PrivateGenericClass._privateStaticMethod'.
+ // ^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] Member not found: '_PrivateGenericClass._privateStaticMethod'.
}
}
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_test.dart
index 03b3d6e..94ad2d9 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_static_methods_test.dart
@@ -20,7 +20,9 @@
AlsoPublicClass.staticMethod().expectStaticType<Exactly<int>>();
Expect.equals(
- privateLibrarySentinel, PublicGenericClassOfInt.staticMethod());
+ privateLibrarySentinel,
+ PublicGenericClassOfInt.staticMethod(),
+ );
PublicGenericClassOfInt.staticMethod().expectStaticType<Exactly<int>>();
}
}
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_try_catch_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_try_catch_test.dart
index 48da8a3..7e09448 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_try_catch_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_try_catch_test.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.
-
// Test that private names exported via public typedefs can be used in a try
// catch.
diff --git a/tests/language/nonfunction_type_aliases/private_names/private_name_types_test.dart b/tests/language/nonfunction_type_aliases/private_names/private_name_types_test.dart
index d9e13d8..a1b539b 100644
--- a/tests/language/nonfunction_type_aliases/private_names/private_name_types_test.dart
+++ b/tests/language/nonfunction_type_aliases/private_names/private_name_types_test.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.
-
// Test that private names exported via public typedefs work correctly as
// types.
diff --git a/tests/language/nonfunction_type_aliases/usage_class_error_test.dart b/tests/language/nonfunction_type_aliases/usage_class_error_test.dart
index 82f418f..e2aa711 100644
--- a/tests/language/nonfunction_type_aliases/usage_class_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_class_error_test.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.
-
// Introduce an aliased type.
class A {
@@ -16,14 +15,18 @@
abstract class C {}
abstract class D2 extends C with T {}
+// ^
+// [cfe] Can't use 'A' as a mixin because it has constructors.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
+// [cfe] The class 'A' can't be used as a mixin because it isn't a mixin class nor a mixin.
abstract class D4 = C with T;
+// ^
+// [cfe] Can't use 'A' as a mixin because it has constructors.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
+// [cfe] The class 'A' can't be used as a mixin because it isn't a mixin class nor a mixin.
main() {
T();
diff --git a/tests/language/nonfunction_type_aliases/usage_class_test.dart b/tests/language/nonfunction_type_aliases/usage_class_test.dart
index 39e2df5..850f4dc 100644
--- a/tests/language/nonfunction_type_aliases/usage_class_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_class_test.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.
-
// Introduce an aliased type.
class A {
@@ -31,7 +30,7 @@
List<T> v11 = [];
final T v12;
- C(): v12 = T();
+ C() : v12 = T();
C.name1(this.v10, this.v12);
factory C.name2(T arg1, T arg2) = C1.name1;
@@ -48,6 +47,7 @@
}
class D1 extends T {}
+
abstract class D3 implements T {}
extension E on T {
diff --git a/tests/language/nonfunction_type_aliases/usage_dynamic_error_test.dart b/tests/language/nonfunction_type_aliases/usage_dynamic_error_test.dart
index 5e47650..874926e 100644
--- a/tests/language/nonfunction_type_aliases/usage_dynamic_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_dynamic_error_test.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.
-
// Introduce an aliased type.
typedef T = dynamic;
@@ -12,31 +11,35 @@
abstract class C {
final T v12;
- C(): v12 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v12 = T();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
}
class D1 extends T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
abstract class D2 extends C with T {}
+// ^
+// [cfe] The type 'T' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
abstract class D3 implements T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
abstract class D4 = C with T;
+// ^
+// [cfe] The type 'T' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'dynamic' can't be used as supertype because it is nullable.
X foo<X>(X x) => x;
@@ -44,26 +47,26 @@
var v14 = <Set<T>, Set<T>>{{}: {}};
v14[{}] = {T()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
-
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
+
T();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T.named();
//^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'named' isn't defined for the class 'Type'.
T v17 = foo<T>(T());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T.staticMethod<T>();
//^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'staticMethod' isn't defined for the class 'Type'.
}
diff --git a/tests/language/nonfunction_type_aliases/usage_dynamic_test.dart b/tests/language/nonfunction_type_aliases/usage_dynamic_test.dart
index 6d86d12..29c65f5 100644
--- a/tests/language/nonfunction_type_aliases/usage_dynamic_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_dynamic_test.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.
-
// Introduce an aliased type.
typedef T = dynamic;
diff --git a/tests/language/nonfunction_type_aliases/usage_function_error_test.dart b/tests/language/nonfunction_type_aliases/usage_function_error_test.dart
index b0eb1a4..53bce10 100644
--- a/tests/language/nonfunction_type_aliases/usage_function_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_function_error_test.dart
@@ -12,30 +12,32 @@
final T v12;
C() : v12 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
}
class D1<X> extends T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
+// [cfe] The class 'Function' can't be extended outside of its library because it's a final class.
abstract class D2 extends C with T {}
+// ^
+// [cfe] The type 'D2' must be 'base', 'final' or 'sealed' because the supertype 'Function' is 'final'.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
+// [cfe] The class 'Function' can't be used as a mixin because it isn't a mixin class nor a mixin.
abstract class D3<X, Y> implements T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
+// [cfe] The class 'Function' can't be implemented outside of its library because it's a final class.
abstract class D4 = C with T;
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
+// [cfe] The class 'Function' can't be used as a mixin because it isn't a mixin class nor a mixin.
X foo<X>(X x) => x;
@@ -43,21 +45,21 @@
var v14 = <Set<T>, Set<T>>{{}: {}};
v14[{}] = {T()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
T();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
T.named();
//^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] Member not found: 'Function.named'.
T v17 = foo<T>(T());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
+ // [cfe] The class 'Function' is abstract and can't be instantiated.
}
diff --git a/tests/language/nonfunction_type_aliases/usage_futureor_error_test.dart b/tests/language/nonfunction_type_aliases/usage_futureor_error_test.dart
index 7846432..975727bb 100644
--- a/tests/language/nonfunction_type_aliases/usage_futureor_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_futureor_error_test.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.
-
import 'dart:async';
// Introduce an aliased type.
@@ -14,31 +13,39 @@
abstract class C {
final T v12;
- C(): v12 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v12 = T();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // [cfe] Couldn't find constructor 'T'.
}
class D1 extends T {}
+// ^
+// [cfe] The superclass, 'FutureOr', has no unnamed constructor that takes no arguments.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
abstract class D2 extends C with T {}
+// ^
+// [cfe] Can't use 'FutureOr' as a mixin because it has constructors.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+// [cfe] The class 'FutureOr' can't be used as a mixin because it isn't a mixin class nor a mixin.
+// [cfe] The type 'T' which is an alias of 'FutureOr<int>' can't be used as supertype.
abstract class D3 implements T {}
+// ^
+// [cfe] The type 'FutureOr' can't be used in an 'implements' clause.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
abstract class D4 = C with T;
+// ^
+// [cfe] Can't use 'FutureOr' as a mixin because it has constructors.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+// [cfe] The class 'FutureOr' can't be used as a mixin because it isn't a mixin class nor a mixin.
+// [cfe] The type 'T' which is an alias of 'FutureOr<int>' can't be used as supertype.
X foo<X>(X x) => x;
@@ -46,26 +53,27 @@
var v14 = <Set<T>, Set<T>>{{}: {}};
v14[{}] = {T()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // [cfe] Couldn't find constructor 'T'.
T();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // [cfe] Couldn't find constructor 'T'.
T.named();
//^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] Member not found: 'FutureOr.named'.
T v17 = foo<T>(T());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
+ // [cfe] Couldn't find constructor 'T'.
T.staticMethod<T>();
//^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] A constructor invocation can't have type arguments after the constructor name.
+ // [cfe] Member not found: 'FutureOr.staticMethod'.
}
diff --git a/tests/language/nonfunction_type_aliases/usage_futureor_test.dart b/tests/language/nonfunction_type_aliases/usage_futureor_test.dart
index 518c8ca..90aff77 100644
--- a/tests/language/nonfunction_type_aliases/usage_futureor_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_futureor_test.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.
-
import 'dart:async';
// Introduce an aliased type.
diff --git a/tests/language/nonfunction_type_aliases/usage_null_test.dart b/tests/language/nonfunction_type_aliases/usage_null_test.dart
index 6681083..3f63290 100644
--- a/tests/language/nonfunction_type_aliases/usage_null_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_null_test.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.
-
// Introduce an aliased type.
typedef T = Null;
@@ -25,7 +24,7 @@
List<T> v11 = [];
final T v12;
- C(): v12 = null;
+ C() : v12 = null;
C.name1(this.v10, this.v12);
factory C.name2(T arg1, T arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/usage_object_error_test.dart b/tests/language/nonfunction_type_aliases/usage_object_error_test.dart
index 28576fc..fa81ea2 100644
--- a/tests/language/nonfunction_type_aliases/usage_object_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_object_error_test.dart
@@ -11,7 +11,7 @@
class C {
T? v10;
final T v12;
- C(): v12 = T();
+ C() : v12 = T();
C.name1(this.v10, this.v12);
factory C.name2(T arg1, T arg2) = C.name1;
}
@@ -38,13 +38,13 @@
main() {
T.named();
-// ^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
-// [cfe] Member not found: 'Object.named'.
+ //^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] Member not found: 'Object.named'.
T.staticMethod<T>();
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
-// [cfe] A constructor invocation can't have type arguments after the constructor name.
-// [cfe] Member not found: 'Object.staticMethod'.
+ //^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] A constructor invocation can't have type arguments after the constructor name.
+ // [cfe] Member not found: 'Object.staticMethod'.
}
diff --git a/tests/language/nonfunction_type_aliases/usage_object_legacy_error_test.dart b/tests/language/nonfunction_type_aliases/usage_object_legacy_error_test.dart
index ba85240..d691a32 100644
--- a/tests/language/nonfunction_type_aliases/usage_object_legacy_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_object_legacy_error_test.dart
@@ -7,7 +7,6 @@
// should be left at 2.19.
// @dart=2.19
-
// Introduce an aliased type.
typedef T = Object;
@@ -17,7 +16,7 @@
abstract class C {
T? v10;
final T v12;
- C(): v12 = T();
+ C() : v12 = T();
C.name1(this.v10, this.v12);
factory C.name2(T arg1, T arg2) = C1.name1;
}
@@ -29,28 +28,31 @@
abstract class D2 extends C with T {}
// ^
-// [analyzer] unspecified
// [cfe] Can't use 'Object' as a mixin because it has constructors.
+// ^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
abstract class D3 implements T {}
// ^
-// [analyzer] unspecified
// [cfe] 'Object' can't be used in both 'extends' and 'implements' clauses.
+// ^
+// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_SUPER_CLASS
abstract class D4 = C with T;
// ^
-// [analyzer] unspecified
// [cfe] Can't use 'Object' as a mixin because it has constructors.
+// ^
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
main() {
T.named();
// ^^^^^
-// [analyzer] unspecified
+// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// [cfe] Member not found: 'Object.named'.
T.staticMethod<T>();
// ^^^^^^^^^^^^
-// [analyzer] unspecified
+// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// [cfe] Member not found: 'Object.staticMethod'.
}
diff --git a/tests/language/nonfunction_type_aliases/usage_object_test.dart b/tests/language/nonfunction_type_aliases/usage_object_test.dart
index 6c24de8..42cf0b8 100644
--- a/tests/language/nonfunction_type_aliases/usage_object_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_object_test.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.
-
// Introduce an aliased type.
typedef T = Object;
@@ -25,7 +24,7 @@
List<T> v11 = [];
final T v12;
- C(): v12 = T();
+ C() : v12 = T();
C.name1(this.v10, this.v12);
factory C.name2(T arg1, T arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/usage_type_variable_error_test.dart b/tests/language/nonfunction_type_aliases/usage_type_variable_error_test.dart
index 4943ea8..57eeb49 100644
--- a/tests/language/nonfunction_type_aliases/usage_type_variable_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_type_variable_error_test.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.
-
// Introduce an aliased type.
class A {
@@ -18,32 +17,36 @@
class C {
final T v12;
- C(): v12 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v12 = T();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
}
class D1 extends T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
abstract class D2 extends C with T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [cfe] The type 'T' can't be mixed in.
+// ^
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
abstract class D3 implements T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
-
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
abstract class D4 = C with T;
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [cfe] The type 'T' can't be mixed in.
+// ^
+// [analyzer] COMPILE_TIME_ERROR.SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER
+// [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
X foo<X>(X x) => x;
@@ -51,36 +54,46 @@
var v14 = <Set<T>, Set<T>>{{}: {}};
v14[{}] = {T()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T v17 = foo<T>(T());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T.named();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3]
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ //^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'named' isn't defined for the class 'Type'.
T().unknownInstanceMethod();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ // [cfe] Couldn't find constructor 'T'.
T.staticMethod<T>();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3]
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ //^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'staticMethod' isn't defined for the class 'Type'.
T.unknownStaticMethod();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3]
+ // [cfe] Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+ //^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'unknownStaticMethod' isn't defined for the class 'Type'.
}
diff --git a/tests/language/nonfunction_type_aliases/usage_type_variable_test.dart b/tests/language/nonfunction_type_aliases/usage_type_variable_test.dart
index 917cac8..5515107 100644
--- a/tests/language/nonfunction_type_aliases/usage_type_variable_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_type_variable_test.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.
-
// Introduce an aliased type.
class A {
@@ -31,7 +30,7 @@
List<T> v11 = [];
final T? v12;
- C(): v12 = null;
+ C() : v12 = null;
C.name1(this.v10, this.v12);
factory C.name2(T arg1, T arg2) = C1.name1;
diff --git a/tests/language/nonfunction_type_aliases/usage_void_error_test.dart b/tests/language/nonfunction_type_aliases/usage_void_error_test.dart
index e6009c6..dd5e686 100644
--- a/tests/language/nonfunction_type_aliases/usage_void_error_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_void_error_test.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.
-
// Introduce an aliased type.
typedef T = void;
@@ -12,31 +11,35 @@
abstract class C {
final T v12;
- C(): v12 = T();
- // ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ C() : v12 = T();
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
}
class D1 extends T {}
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// ^
+// [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'void' can't be used as supertype because it is nullable.
abstract class D2 extends C with T {}
+// ^
+// [cfe] The type 'T' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'void' can't be used as supertype because it is nullable.
abstract class D3 implements T {}
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'void' can't be used as supertype because it is nullable.
abstract class D4 = C with T;
+// ^
+// [cfe] The type 'T' can't be mixed in.
// ^
-// [analyzer] unspecified
-// [cfe] unspecified
+// [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS
+// [cfe] The type 'T' which is an alias of 'void' can't be used as supertype because it is nullable.
X foo<X>(X x) => x;
@@ -44,26 +47,26 @@
var v14 = <Set<T>, Set<T>>{{}: {}};
v14[{}] = {T()};
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T();
-//^
-// [analyzer] unspecified
-// [cfe] unspecified
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T.named();
//^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'named' isn't defined for the class 'Type'.
T v17 = foo<T>(T());
// ^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION
+ // [cfe] Couldn't find constructor 'T'.
T.staticMethod<T>();
//^^^^^^^^^^^^
- // [analyzer] unspecified
- // [cfe] unspecified
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'staticMethod' isn't defined for the class 'Type'.
}
diff --git a/tests/language/nonfunction_type_aliases/usage_void_test.dart b/tests/language/nonfunction_type_aliases/usage_void_test.dart
index c545715..7ca394c 100644
--- a/tests/language/nonfunction_type_aliases/usage_void_test.dart
+++ b/tests/language/nonfunction_type_aliases/usage_void_test.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.
-
// Introduce an aliased type.
typedef T = void;
diff --git a/tests/language/nosuchmethod_forwarding/nosuchmethod_forwarding_arguments_test.dart b/tests/language/nosuchmethod_forwarding/nosuchmethod_forwarding_arguments_test.dart
index 9c3edac..e089566 100644
--- a/tests/language/nosuchmethod_forwarding/nosuchmethod_forwarding_arguments_test.dart
+++ b/tests/language/nosuchmethod_forwarding/nosuchmethod_forwarding_arguments_test.dart
@@ -108,19 +108,27 @@
Expect.throwsTypeError(() => (a as dynamic).test7 = "hi");
a.allTogetherNow<num, double>(2.0, foo: const <num>[3, 4]);
- Expect.throwsTypeError(() =>
- (a.allTogetherNow as dynamic)<int, double>(2.0, foo: const <num>[3, 4]));
- Expect.throwsTypeError(() =>
- (a.allTogetherNow as dynamic)<int, int>(2.0, foo: const <num>[3, 4]));
- Expect.throwsTypeError(() => (a.allTogetherNow
- as dynamic)<double, double>(2.0, foo: const <int>[3, 4]));
+ Expect.throwsTypeError(
+ () =>
+ (a.allTogetherNow as dynamic)<int, double>(2.0, foo: const <num>[3, 4]),
+ );
+ Expect.throwsTypeError(
+ () => (a.allTogetherNow as dynamic)<int, int>(2.0, foo: const <num>[3, 4]),
+ );
+ Expect.throwsTypeError(
+ () => (a.allTogetherNow as dynamic)<double, double>(
+ 2.0,
+ foo: const <int>[3, 4],
+ ),
+ );
a.test8();
a.test9<num, double>(4.2, foo: 3);
Expect.throwsTypeError(() => (a.test9 as dynamic)<int, double>(3, foo: 3));
Expect.throwsTypeError(
- () => (a.test9 as dynamic)<double, double>(3, foo: 3.2));
+ () => (a.test9 as dynamic)<double, double>(3, foo: 3.2),
+ );
// Added to check that uses of positions from the ArgumentsDescriptor in the
// VM properly offsets named argument positions if there are also type
// arguments. allTogetherNow doesn't work for this because the runtime type of
@@ -128,5 +136,6 @@
// argument without the positional argument failing to match its own type,
// and positional argument types are usually checked first.
Expect.throwsTypeError(
- () => (a.test9 as dynamic)<int, double>(4.2, foo: 3.2));
+ () => (a.test9 as dynamic)<int, double>(4.2, foo: 3.2),
+ );
}
diff --git a/tests/language/null/checked_null_test.dart b/tests/language/null/checked_null_test.dart
index 9d57242..885bc9a 100644
--- a/tests/language/null/checked_null_test.dart
+++ b/tests/language/null/checked_null_test.dart
@@ -9,9 +9,7 @@
Comparator? b;
// This code exhibited a bug in dart2js, where the type of [a] was inferred to
// be [Comparator] or null;
- A()
- : b = null,
- a = null;
+ A() : b = null, a = null;
}
main() {
diff --git a/tests/language/null/checked_runtime_test.dart b/tests/language/null/checked_runtime_test.dart
index 31ace35..699c4fd 100644
--- a/tests/language/null/checked_runtime_test.dart
+++ b/tests/language/null/checked_runtime_test.dart
@@ -12,19 +12,14 @@
Comparator? b;
// This code exhibited a bug in dart2js, where the type of [a] was inferred to
// be [Comparator] or null;
- A()
- : b = null,
- a = null;
+ A() : b = null, a = null;
}
-main() {
-
-}
+main() {}
bar() {
// We would create a typed selector for the call to foo, where the
// receiver type is a typedef. Some code in the dart2js backend were
// not dealing correctly with typedefs and lead the compiler to
// crash.
-
}
diff --git a/tests/language/null/inherit_static_errors_legacy_test.dart b/tests/language/null/inherit_static_errors_legacy_test.dart
index aae684a..dccf8a4 100644
--- a/tests/language/null/inherit_static_errors_legacy_test.dart
+++ b/tests/language/null/inherit_static_errors_legacy_test.dart
@@ -8,38 +8,34 @@
// @dart=2.19
class BadExtends extends Null {}
-// ^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
-// [cfe] The superclass, 'Null', has no unnamed constructor that takes no arguments.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
-// ^
+// [cfe] The superclass, 'Null', has no unnamed constructor that takes no arguments.
+// ^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
class BadImplements implements Null {}
-// ^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
-// ^
+// ^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
class BadMixin extends Object with Null {}
-// ^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
-// ^
+// ^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
class BadMixin2 = Object with Null;
-// ^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// ^
// [cfe] 'Null' is restricted and can't be extended or implemented.
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
-// ^
+// ^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
// [cfe] 'Null' is restricted and can't be extended or implemented.
diff --git a/tests/language/null_aware/assignment_test.dart b/tests/language/null_aware/assignment_test.dart
index be318ed..9b548f3 100644
--- a/tests/language/null_aware/assignment_test.dart
+++ b/tests/language/null_aware/assignment_test.dart
@@ -196,13 +196,13 @@
{
B bname = new C(1);
bname?.v += 2;
-// ^^
-// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
-// ^
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
-// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER
-// [cfe] The getter 'v' isn't defined for the class 'B'.
-// [cfe] The setter 'v' isn't defined for the class 'B'.
+ // ^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER
+ // [cfe] The getter 'v' isn't defined for the class 'B'.
+ // [cfe] The setter 'v' isn't defined for the class 'B'.
}
{
D d = new D(new E());
@@ -265,21 +265,21 @@
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
h?.topLevelVar = null;
-//^
-// [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
-// [cfe] A prefix can't be used with null-aware operators.
-// ^
-// [cfe] Can't assign to this.
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
+ // [cfe] A prefix can't be used with null-aware operators.
+ // ^
+ // [cfe] Can't assign to this.
h?.topLevelVar += null;
-//^
-// [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
-// [cfe] A prefix can't be used with null-aware operators.
-// ^
-// [cfe] Can't assign to this.
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
+ // [cfe] A prefix can't be used with null-aware operators.
+ // ^
+ // [cfe] Can't assign to this.
h?.topLevelVar ??= null;
-//^
-// [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
-// [cfe] A prefix can't be used with null-aware operators.
-// ^
-// [cfe] Can't assign to this.
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
+ // [cfe] A prefix can't be used with null-aware operators.
+ // ^
+ // [cfe] Can't assign to this.
}
diff --git a/tests/language/null_aware/invocation_test.dart b/tests/language/null_aware/invocation_test.dart
index 1eaf015..5f76f66 100644
--- a/tests/language/null_aware/invocation_test.dart
+++ b/tests/language/null_aware/invocation_test.dart
@@ -43,56 +43,85 @@
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
- { int? i = nullC()?.g(bad()); Expect.equals(null, i); }
- { int? i = c?.g(() => 1); Expect.equals(1, i); }
- { String? s = nullC()?.g(bad()); Expect.equals(null, s); }
- // ^^^^^^^^^^^^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
- // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
- { String? s = c?.g(() => null); Expect.equals(null, s); }
- // ^^^^^^^^^^^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
- // ^
- // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
- { int? i = C?.staticG(() => 1); Expect.equals(1, i); }
- // ^^
- // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
- { int? i = h.C?.staticG(() => 1); Expect.equals(1, i); }
- // ^^
- // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
- { String? s = C?.staticG(() => null); Expect.equals(null, s); }
- // ^^^^^^^^^^^^^^^^^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
- // ^^
- // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
- // ^
- // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
- { String? s = h.C?.staticG(() => null); Expect.equals(null, s); }
- // ^^^^^^^^^^^^^^^^^^^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
- // ^^
- // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
- // ^
- // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
+ {
+ int? i = nullC()?.g(bad());
+ Expect.equals(null, i);
+ }
+ {
+ int? i = c?.g(() => 1);
+ Expect.equals(1, i);
+ }
+ {
+ String? s = nullC()?.g(bad());
+ // ^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
+ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
+ Expect.equals(null, s);
+ }
+ {
+ String? s = c?.g(() => null);
+ // ^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
+ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
+ Expect.equals(null, s);
+ }
+ {
+ int? i = C?.staticG(() => 1);
+ // ^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+ Expect.equals(1, i);
+ }
+ {
+ int? i = h.C?.staticG(() => 1);
+ // ^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+ Expect.equals(1, i);
+ }
+ {
+ String? s = C?.staticG(() => null);
+ // ^^^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
+ // ^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+ // ^
+ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
+ Expect.equals(null, s);
+ }
+ {
+ String? s = h.C?.staticG(() => null);
+ // ^^^^^^^^^^^^^^^^^^^^^^^^
+ // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
+ // ^^
+ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+ // ^
+ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'.
+ Expect.equals(null, s);
+ }
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
- { var b = new C() as B?; Expect.equals(1, b?.f(() => 1)); }
- // ^
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
- // [cfe] The method 'f' isn't defined for the class 'B'.
- { var i = 1 as int?; Expect.equals(null, nullC()?.f(i)); }
- // ^
- // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
- // [cfe] The argument type 'int?' can't be assigned to the parameter type 'dynamic Function()?'.
+ {
+ var b = new C() as B?;
+ Expect.equals(1, b?.f(() => 1));
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
+ // [cfe] The method 'f' isn't defined for the class 'B'.
+ }
+ {
+ var i = 1 as int?;
+ Expect.equals(null, nullC()?.f(i));
+ // ^
+ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
+ // [cfe] The argument type 'int?' can't be assigned to the parameter type 'dynamic Function()?'.
+ }
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
h?.topLevelFunction();
-//^
-// [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
-// [cfe] A prefix can't be used with null-aware operators.
+ // [error column 3, length 1]
+ // [analyzer] COMPILE_TIME_ERROR.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
+ // [cfe] A prefix can't be used with null-aware operators.
// Nor can it be used to access the toString method on the class Type.
Expect.throwsNoSuchMethodError(() => C?.toString());
diff --git a/tests/language/null_aware/opt_test.dart b/tests/language/null_aware/opt_test.dart
index 57f3848..1cc0ec9 100644
--- a/tests/language/null_aware/opt_test.dart
+++ b/tests/language/null_aware/opt_test.dart
@@ -33,10 +33,12 @@
Expect.equals(null, c?.v);
Expect.equals(10, c ?? 10);
Expect.equals(d, d ?? bomb());
- var list = [[3]] as List<List<int>>?;
- Expect.equals(
- 3,
- list?.expand((i) => i).toList()[0]);
+ var list =
+ [
+ [3],
+ ]
+ as List<List<int>>?;
+ Expect.equals(3, list?.expand((i) => i).toList()[0]);
Expect.equals(null, (null as dynamic)?.expand((i) => i)?.toList());
var e;
diff --git a/tests/language/null_aware/prefix_not_shortening_test.dart b/tests/language/null_aware/prefix_not_shortening_test.dart
index 9a9e6cd..f586299 100644
--- a/tests/language/null_aware/prefix_not_shortening_test.dart
+++ b/tests/language/null_aware/prefix_not_shortening_test.dart
@@ -10,13 +10,13 @@
void main() {
final C? c = new C();
- /**/ -c?.e();
- // ^
+ -c?.e();
+ // [error column 3, length 1]
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Operator 'unary-' cannot be called on 'C?' because it is potentially null.
- /**/ ~c?.e();
- // ^
+ ~c?.e();
+ // [error column 3, length 1]
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Operator '~' cannot be called on 'C?' because it is potentially null.
}
diff --git a/tests/language/number/identifier_runtime_test.dart b/tests/language/number/identifier_runtime_test.dart
index 23f1b85..efabade 100644
--- a/tests/language/number/identifier_runtime_test.dart
+++ b/tests/language/number/identifier_runtime_test.dart
@@ -28,10 +28,10 @@
Expect.equals(1e+2, 1e+2 as double);
// `1.e`, etc. are parsed as a property / method access on int.
- Expect.equals(3, 1.e+2);
- Expect.equals(3, 1.d+2);
- Expect.equals(3, 1.D+2);
- Expect.equals(3, 1._0e+2);
+ Expect.equals(3, 1.e + 2);
+ Expect.equals(3, 1.d + 2);
+ Expect.equals(3, 1.D + 2);
+ Expect.equals(3, 1._0e + 2);
}
extension on int {
diff --git a/tests/language/number/int64_literal_runtime_10_test.dart b/tests/language/number/int64_literal_runtime_10_test.dart
index 6391a0f..8f7e0ee 100644
--- a/tests/language/number/int64_literal_runtime_10_test.dart
+++ b/tests/language/number/int64_literal_runtime_10_test.dart
@@ -15,26 +15,13 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
maxInt64Value = -0x8000000000000000 - 1;
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_11_test.dart b/tests/language/number/int64_literal_runtime_11_test.dart
index 02ae918..7945650 100644
--- a/tests/language/number/int64_literal_runtime_11_test.dart
+++ b/tests/language/number/int64_literal_runtime_11_test.dart
@@ -15,24 +15,11 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
-
-
maxInt64Value = -(0x8000000000000001);
Expect.equals('$maxInt64Value', realMaxInt64Value);
diff --git a/tests/language/number/int64_literal_runtime_1_test.dart b/tests/language/number/int64_literal_runtime_1_test.dart
index 3b23e7f..c5c0651 100644
--- a/tests/language/number/int64_literal_runtime_1_test.dart
+++ b/tests/language/number/int64_literal_runtime_1_test.dart
@@ -16,25 +16,11 @@
int minInt64Value = -1 * i21 * i21 * i21;
minInt64Value = -9223372036854775807 - 1;
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_2_test.dart b/tests/language/number/int64_literal_runtime_2_test.dart
index 6664a7d..dd92b85 100644
--- a/tests/language/number/int64_literal_runtime_2_test.dart
+++ b/tests/language/number/int64_literal_runtime_2_test.dart
@@ -17,24 +17,11 @@
minInt64Value = -9223372036854775808;
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_3_test.dart b/tests/language/number/int64_literal_runtime_3_test.dart
index 6a474c9..741f81e 100644
--- a/tests/language/number/int64_literal_runtime_3_test.dart
+++ b/tests/language/number/int64_literal_runtime_3_test.dart
@@ -15,26 +15,13 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
minInt64Value = -(0x8000000000000000);
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_4_test.dart b/tests/language/number/int64_literal_runtime_4_test.dart
index e40dd6b..d7df159 100644
--- a/tests/language/number/int64_literal_runtime_4_test.dart
+++ b/tests/language/number/int64_literal_runtime_4_test.dart
@@ -15,26 +15,13 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
minInt64Value = 0x8000000000000000;
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_5_test.dart b/tests/language/number/int64_literal_runtime_5_test.dart
index d9f1aac..f08c9b2 100644
--- a/tests/language/number/int64_literal_runtime_5_test.dart
+++ b/tests/language/number/int64_literal_runtime_5_test.dart
@@ -15,10 +15,6 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
minInt64Value = -0x8000000000000000;
Expect.equals('$minInt64Value', realMinInt64Value);
@@ -26,15 +22,6 @@
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_6_test.dart b/tests/language/number/int64_literal_runtime_6_test.dart
index fefa1f3..d2bda18 100644
--- a/tests/language/number/int64_literal_runtime_6_test.dart
+++ b/tests/language/number/int64_literal_runtime_6_test.dart
@@ -15,26 +15,12 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
maxInt64Value = 9223372036854775807;
-
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_7_test.dart b/tests/language/number/int64_literal_runtime_7_test.dart
index 227ea41..aae70fe 100644
--- a/tests/language/number/int64_literal_runtime_7_test.dart
+++ b/tests/language/number/int64_literal_runtime_7_test.dart
@@ -15,12 +15,6 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
@@ -28,13 +22,6 @@
maxInt64Value = 9223372036854775807;
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_8_test.dart b/tests/language/number/int64_literal_runtime_8_test.dart
index 07ba174..124026e 100644
--- a/tests/language/number/int64_literal_runtime_8_test.dart
+++ b/tests/language/number/int64_literal_runtime_8_test.dart
@@ -15,26 +15,13 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
maxInt64Value = -9223372036854775808 - 1;
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_9_test.dart b/tests/language/number/int64_literal_runtime_9_test.dart
index 7aabfc2..b835c35 100644
--- a/tests/language/number/int64_literal_runtime_9_test.dart
+++ b/tests/language/number/int64_literal_runtime_9_test.dart
@@ -15,26 +15,13 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
maxInt64Value = 0x8000000000000000 - 1;
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/int64_literal_runtime_test.dart b/tests/language/number/int64_literal_runtime_test.dart
index d135bb1..4e9d5d4 100644
--- a/tests/language/number/int64_literal_runtime_test.dart
+++ b/tests/language/number/int64_literal_runtime_test.dart
@@ -15,26 +15,11 @@
main() {
int minInt64Value = -1 * i21 * i21 * i21;
-
-
-
-
-
-
Expect.equals('$minInt64Value', realMinInt64Value);
Expect.equals('${minInt64Value - 1}', realMaxInt64Value);
int maxInt64Value = 1 * i21 * i21 * i21 - 1;
-
-
-
-
-
-
-
-
-
Expect.equals('$maxInt64Value', realMaxInt64Value);
Expect.equals('${maxInt64Value + 1}', realMinInt64Value);
}
diff --git a/tests/language/number/separators_test.dart b/tests/language/number/separators_test.dart
index 522d3df..feada3e 100644
--- a/tests/language/number/separators_test.dart
+++ b/tests/language/number/separators_test.dart
@@ -20,15 +20,20 @@
Expect.equals(-99, -00_99);
Expect.equals(0, 0__0__0__0__0);
- if (!v.jsNumbers) { // Won't parse on the web.
+ // Won't parse on the web.
+ if (!v.jsNumbers) {
// 2^63-1, max native int.
- Expect.equals(maxNativeInt,
- // == (2^53 - 1) * 2^10 == (65536 * 65536 * 65536 * 32 - 1) * 1024
- 0__9__2__2__3__3__7__2__0__3__6__8__5__4__7__7__4__7__8__4);
+ Expect.equals(
+ maxNativeInt,
+ // == (2^53 - 1) * 2^10 == (65536 * 65536 * 65536 * 32 - 1) * 1024
+ 0__9__2__2__3__3__7__2__0__3__6__8__5__4__7__7__4__7__8__4,
+ );
// Hexadecimal.
- Expect.equals(maxNativeInt,
- // == (2^53 - 1) * 2^10 == (65536 * 65536 * 65536 * 32 - 1) * 1024
- 0x0___7__F__F__F__F__F__F__F__F__F__F__F__F__C__0__0);
+ Expect.equals(
+ maxNativeInt,
+ // == (2^53 - 1) * 2^10 == (65536 * 65536 * 65536 * 32 - 1) * 1024
+ 0x0___7__F__F__F__F__F__F__F__F__F__F__F__F__C__0__0,
+ );
// Unsigned large hex literal.
// TODO(srawlins): Add test cases that can be run on the web and the VM. Something like:
@@ -39,13 +44,19 @@
// (== -2048).
}
// Min native int, valid web number, -2^63.
- Expect.equals(minNativeInt,
- -0__9__2__2__3__3__7__2__0__3__6__8__5__4__7__7__5__8__0__8);
- Expect.equals(minNativeInt,
- -0x0___8__0__0__0___0__0__0__0___0__0__0__0___0__0__0__0);
+ Expect.equals(
+ minNativeInt,
+ -0__9__2__2__3__3__7__2__0__3__6__8__5__4__7__7__5__8__0__8,
+ );
+ Expect.equals(
+ minNativeInt,
+ -0x0___8__0__0__0___0__0__0__0___0__0__0__0___0__0__0__0,
+ );
// As unsigned literal. Overflows to negative on native.
- Expect.equals(v.jsNumbers ? -minNativeInt : minNativeInt,
- 0x0___8__0__0__0___0__0__0__0___0__0__0__0___0__0__0__0);
+ Expect.equals(
+ v.jsNumbers ? -minNativeInt : minNativeInt,
+ 0x0___8__0__0__0___0__0__0__0___0__0__0__0___0__0__0__0,
+ );
// Doubles.
Expect.equals(3.141592653, 3.141_592_653);
@@ -65,15 +76,32 @@
Expect.equals(0.0, 0__0.0__0e0__0);
// Max finite double as decimal literal.
- Expect.equals(1.7976931348623157e+308, asDouble(0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8));
+ Expect.equals(
+ 1.7976931348623157e+308,
+ asDouble(
+ 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8,
+ ),
+ );
- Expect.equals(1.7976931348623157e+308, 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8.0__0);
+ Expect.equals(
+ 1.7976931348623157e+308,
+ 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8.0__0,
+ );
- Expect.equals(1.7976931348623157e+308, 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8e0__0);
+ Expect.equals(
+ 1.7976931348623157e+308,
+ 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8e0__0,
+ );
- Expect.equals(1.7976931348623157e+308, 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3.2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8e0__6__7);
+ Expect.equals(
+ 1.7976931348623157e+308,
+ 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3.2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8e0__6__7,
+ );
- Expect.equals(1.7976931348623157e+308, 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8__0__0__0__0__0__0__0__0__0__0__0__0e-0__1__2);
+ Expect.equals(
+ 1.7976931348623157e+308,
+ 0__1__7__9__7__6__9__3__1__3__4__8__6__2__3__1__5__7__0__8__1__4__5__2__7__4__2__3__7__3__1__7__0__4__3__5__6__7__9__8__0__7__0__5__6__7__5__2__5__8__4__4__9__9__6__5__9__8__9__1__7__4__7__6__8__0__3__1__5__7__2__6__0__7__8__0__0__2__8__5__3__8__7__6__0__5__8__9__5__5__8__6__3__2__7__6__6__8__7__8__1__7__1__5__4__0__4__5__8__9__5__3__5__1__4__3__8__2__4__6__4__2__3__4__3__2__1__3__2__6__8__8__9__4__6__4__1__8__2__7__6__8__4__6__7__5__4__6__7__0__3__5__3__7__5__1__6__9__8__6__0__4__9__9__1__0__5__7__6__5__5__1__2__8__2__0__7__6__2__4__5__4__9__0__0__9__0__3__8__9__3__2__8__9__4__4__0__7__5__8__6__8__5__0__8__4__5__5__1__3__3__9__4__2__3__0__4__5__8__3__2__3__6__9__0__3__2__2__2__9__4__8__1__6__5__8__0__8__5__5__9__3__3__2__1__2__3__3__4__8__2__7__4__7__9__7__8__2__6__2__0__4__1__4__4__7__2__3__1__6__8__7__3__8__1__7__7__1__8__0__9__1__9__2__9__9__8__8__1__2__5__0__4__0__4__0__2__6__1__8__4__1__2__4__8__5__8__3__6__8__0__0__0__0__0__0__0__0__0__0__0__0e-0__1__2,
+ );
Expect.equals(double.infinity, 2e3__0__8);
Expect.equals(double.infinity, 2__0__0e3__0__6);