diff --git a/tests/language/value_class/has_non_final_field_error_test.dart b/tests/language/value_class/has_non_final_field_error_test.dart index d0ed8e51a6c..9a81564a8d2 100644 --- a/tests/language/value_class/has_non_final_field_error_test.dart +++ b/tests/language/value_class/has_non_final_field_error_test.dart @@ -9,6 +9,7 @@ import 'value_class_support_lib.dart'; @valueClass class Animal { int numberOfLegs; - //^ - // [cfe] unspecified + // ^^^^^^^^^^^^ + // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD + // [cfe] Field 'numberOfLegs' should be initialized because its type 'int' doesn't allow null. } diff --git a/tests/language/variable/bad_initializer1_runtime_test.dart b/tests/language/variable/bad_initializer1_runtime_test.dart index e97f36ba317..768e6404576 100644 --- a/tests/language/variable/bad_initializer1_runtime_test.dart +++ b/tests/language/variable/bad_initializer1_runtime_test.dart @@ -9,15 +9,8 @@ main() { const elems = const [ - const [ - 1, - 2.0, - true, - false, - 0xffffffffff, - - ], + const [1, 2.0, true, false, 0xffffffffff], "a", - "b" + "b", ]; } diff --git a/tests/language/variable/bad_initializer1_test.dart b/tests/language/variable/bad_initializer1_test.dart index 57cd57c8d3e..fe08dc2cc70 100644 --- a/tests/language/variable/bad_initializer1_test.dart +++ b/tests/language/variable/bad_initializer1_test.dart @@ -6,21 +6,21 @@ main() { const elems = const [ - // ^^^^^ - // [analyzer] COMPILE_TIME_ERROR.RECURSIVE_COMPILE_TIME_CONSTANT + // ^^^^^ + // [analyzer] COMPILE_TIME_ERROR.RECURSIVE_COMPILE_TIME_CONSTANT const [ 1, 2.0, true, false, 0xffffffffff, - elems -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION -// [cfe] Local variable 'elems' can't be referenced before it is declared. -// [cfe] Undefined name 'elems'. + elems, + // [error column 7, length 5] + // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION + // [cfe] Local variable 'elems' can't be referenced before it is declared. + // [cfe] Undefined name 'elems'. ], "a", - "b" + "b", ]; } diff --git a/tests/language/variable/bad_initializer2_runtime_test.dart b/tests/language/variable/bad_initializer2_runtime_test.dart index 5163cf01628..10ae9560830 100644 --- a/tests/language/variable/bad_initializer2_runtime_test.dart +++ b/tests/language/variable/bad_initializer2_runtime_test.dart @@ -13,9 +13,7 @@ main() { if (n == 0) { return 0; } else { - return 1 - - ; + return 1; } }; foo(1); diff --git a/tests/language/variable/bad_initializer2_test.dart b/tests/language/variable/bad_initializer2_test.dart index d377181cd8a..3ce1084b878 100644 --- a/tests/language/variable/bad_initializer2_test.dart +++ b/tests/language/variable/bad_initializer2_test.dart @@ -10,16 +10,14 @@ main() { if (n == 0) { return 0; } else { - return 1 - + foo(n - 1) - //^^^ - // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION - // [cfe] Local variable 'foo' can't be referenced before it is declared. - // [cfe] Method not found: 'foo'. - ; + return 1 + foo(n - 1); + // ^^^ + // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION + // [cfe] Local variable 'foo' can't be referenced before it is declared. + // [cfe] Method not found: 'foo'. } }; foo(1); -//^ -// [cfe] Method not found: 'foo'. + // [error column 3] + // [cfe] Method not found: 'foo'. } diff --git a/tests/language/variable/duplicate_field_with_initializer_runtime_test.dart b/tests/language/variable/duplicate_field_with_initializer_runtime_test.dart index ab879a634cb..5c60d2c7b55 100644 --- a/tests/language/variable/duplicate_field_with_initializer_runtime_test.dart +++ b/tests/language/variable/duplicate_field_with_initializer_runtime_test.dart @@ -7,7 +7,6 @@ class Repeated { var a = '', b = 'Something'; - } main() {} diff --git a/tests/language/variable/illegal_initializer_runtime_test.dart b/tests/language/variable/illegal_initializer_runtime_test.dart index fecbeba0853..7e9ed6968d2 100644 --- a/tests/language/variable/illegal_initializer_runtime_test.dart +++ b/tests/language/variable/illegal_initializer_runtime_test.dart @@ -11,35 +11,15 @@ class A { } class B extends A { - B.c1() - : super.foo - - () - - ; + B.c1() : super.foo(); B.foo(); - B.c2() - : this.foo + B.c2() : this.foo(); - () - - ; - - B.c3() - : super - - () - - ; + B.c3() : super(); B(); - B.c4() - : this - - () - - ; + B.c4() : this(); } main() { diff --git a/tests/language/variable/illegal_initializer_test.dart b/tests/language/variable/illegal_initializer_test.dart index 3b8b083e50f..73ac547c6f5 100644 --- a/tests/language/variable/illegal_initializer_test.dart +++ b/tests/language/variable/illegal_initializer_test.dart @@ -17,12 +17,11 @@ class B extends A { B.c2() : this.foo; // ^^^^ // [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS - // [cfe] Can't access 'this' in a field initializer. - // ^^^^ // [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER - // [cfe] Expected an assignment after the field name. // ^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD + // [cfe] Can't access 'this' in a field initializer. + // [cfe] Expected an assignment after the field name. // ^^^ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER @@ -39,15 +38,12 @@ class B extends A { B.c4() : this; // ^^^^ // [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD - // [cfe] Expected an assignment after the field name. - // ^^^^ // [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS - // ^^^^ // [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER - // [error line 39, column 16, length 0] - // [cfe] Expected '.' before this. + // [cfe] Expected an assignment after the field name. // ^ // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN + // [cfe] Expected '.' before this. // [cfe] Expected an identifier, but got ''. } diff --git a/tests/language/variable/initializer_super_last_runtime_test.dart b/tests/language/variable/initializer_super_last_runtime_test.dart index a23f5c284f1..0fce414091a 100644 --- a/tests/language/variable/initializer_super_last_runtime_test.dart +++ b/tests/language/variable/initializer_super_last_runtime_test.dart @@ -17,119 +17,67 @@ class S { class C extends S { final int x; - C.cc01(int x) - : x = x, - super(); - C.cc02(int x) - : x = x, - super.named(); + C.cc01(int x) : x = x, super(); + C.cc02(int x) : x = x, super.named(); C.cc03(this.x) : super(); C.cc04(this.x) : super.named(); - C.cc05(int x) - : x = x, - assert(x == x), - super(); - C.cc06(int x) - : x = x, - assert(x == x), - super.named(); - C.cc07(this.x) - : assert(x == x), - super(); - C.cc08(this.x) - : assert(x == x), - super.named(); + C.cc05(int x) : x = x, assert(x == x), super(); + C.cc06(int x) : x = x, assert(x == x), super.named(); + C.cc07(this.x) : assert(x == x), super(); + C.cc08(this.x) : assert(x == x), super.named(); C.cc09(int x) - : // - - x = x; + : // + x = x; C.cc10(int x) - : // - - x = x; + : // + x = x; C.cc11(this.x) - : // - - assert(x == x); + : // + assert(x == x); C.cc12(this.x) - : // - - assert(x == x); + : // + assert(x == x); C.cc13(int x) - : // - - x = x, - assert(x == x); + : // + x = x, + assert(x == x); C.cc14(int x) - : // + : // + x = x, + assert(x == x); + C.cc15(int x) : x = x, assert(x == x); + C.cc16(int x) : x = x, assert(x == x); - x = x, - assert(x == x); - C.cc15(int x) - : x = x, - - assert(x == x); - C.cc16(int x) - : x = x, - - assert(x == x); - - const C.cc17(int x) - : x = x, - super(); - const C.cc18(int x) - : x = x, - super.named(); + const C.cc17(int x) : x = x, super(); + const C.cc18(int x) : x = x, super.named(); const C.cc19(this.x) : super(); const C.cc20(this.x) : super.named(); - const C.cc21(int x) - : x = x, - assert(x == x), - super(); - const C.cc22(int x) - : x = x, - assert(x == x), - super.named(); - const C.cc23(this.x) - : assert(x == x), - super(); - const C.cc24(this.x) - : assert(x == x), - super.named(); + const C.cc21(int x) : x = x, assert(x == x), super(); + const C.cc22(int x) : x = x, assert(x == x), super.named(); + const C.cc23(this.x) : assert(x == x), super(); + const C.cc24(this.x) : assert(x == x), super.named(); const C.cc25(int x) - : // - - x = x; + : // + x = x; const C.cc26(int x) - : // - - x = x; + : // + x = x; const C.cc27(this.x) - : // - - assert(x == x); + : // + assert(x == x); const C.cc28(this.x) - : // - - assert(x == x); + : // + assert(x == x); const C.cc29(int x) - : // - - x = x, - assert(x == x); + : // + x = x, + assert(x == x); const C.cc30(int x) - : // - - x = x, - assert(x == x); - const C.cc31(int x) - : x = x, - - assert(x == x); - const C.cc32(int x) - : x = x, - - assert(x == x); + : // + x = x, + assert(x == x); + const C.cc31(int x) : x = x, assert(x == x); + const C.cc32(int x) : x = x, assert(x == x); } main() { diff --git a/tests/language/variable/initializer_super_last_test.dart b/tests/language/variable/initializer_super_last_test.dart index edcd6456324..1b363b3b62f 100644 --- a/tests/language/variable/initializer_super_last_test.dart +++ b/tests/language/variable/initializer_super_last_test.dart @@ -14,191 +14,151 @@ class S { class C extends S { final int x; - C.cc01(int x) - : x = x, - super(); - C.cc02(int x) - : x = x, - super.named(); + C.cc01(int x) : x = x, super(); + C.cc02(int x) : x = x, super.named(); C.cc03(this.x) : super(); C.cc04(this.x) : super.named(); - C.cc05(int x) - : x = x, - assert(x == x), - super(); - C.cc06(int x) - : x = x, - assert(x == x), - super.named(); - C.cc07(this.x) - : assert(x == x), - super(); - C.cc08(this.x) - : assert(x == x), - super.named(); + C.cc05(int x) : x = x, assert(x == x), super(); + C.cc06(int x) : x = x, assert(x == x), super.named(); + C.cc07(this.x) : assert(x == x), super(); + C.cc08(this.x) : assert(x == x), super.named(); C.cc09(int x) - : // - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x; - //^ - // [cfe] Can't have initializers after 'super'. + : super(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x; + // ^ + // [cfe] Can't have initializers after 'super'. C.cc10(int x) - : // - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x; - //^ - // [cfe] Can't have initializers after 'super'. + : super.named(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x; + // ^ + // [cfe] Can't have initializers after 'super'. C.cc11(this.x) - : // - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. C.cc12(this.x) - : // - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super.named(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. C.cc13(int x) - : // - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x, - //^ - // [cfe] Can't have initializers after 'super'. - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x, + //^ + // [cfe] Can't have initializers after 'super'. + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. C.cc14(int x) - : // - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x, - //^ - // [cfe] Can't have initializers after 'super'. - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super.named(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x, + //^ + // [cfe] Can't have initializers after 'super'. + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. C.cc15(int x) - : x = x, - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : x = x, + super(), + // [error column 7, length 5] + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. C.cc16(int x) - : x = x, - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : x = x, + super.named(), + // [error column 7, length 5] + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. - const C.cc17(int x) - : x = x, - super(); - const C.cc18(int x) - : x = x, - super.named(); + const C.cc17(int x) : x = x, super(); + const C.cc18(int x) : x = x, super.named(); const C.cc19(this.x) : super(); const C.cc20(this.x) : super.named(); - const C.cc21(int x) - : x = x, - assert(x == x), - super(); - const C.cc22(int x) - : x = x, - assert(x == x), - super.named(); - const C.cc23(this.x) - : assert(x == x), - super(); - const C.cc24(this.x) - : assert(x == x), - super.named(); + const C.cc21(int x) : x = x, assert(x == x), super(); + const C.cc22(int x) : x = x, assert(x == x), super.named(); + const C.cc23(this.x) : assert(x == x), super(); + const C.cc24(this.x) : assert(x == x), super.named(); const C.cc25(int x) - : // - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x; - //^ - // [cfe] Can't have initializers after 'super'. + : super(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x; + // ^ + // [cfe] Can't have initializers after 'super'. const C.cc26(int x) - : // - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x; - //^ - // [cfe] Can't have initializers after 'super'. + : super.named(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x; + // ^ + // [cfe] Can't have initializers after 'super'. const C.cc27(this.x) - : // - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. const C.cc28(this.x) - : // - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super.named(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. const C.cc29(int x) - : // - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x, - //^ - // [cfe] Can't have initializers after 'super'. - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x, + //^ + // [cfe] Can't have initializers after 'super'. + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. const C.cc30(int x) - : // - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - x = x, - //^ - // [cfe] Can't have initializers after 'super'. - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : super.named(), + //^^^^^ + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + x = x, + //^ + // [cfe] Can't have initializers after 'super'. + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. const C.cc31(int x) - : x = x, - super(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : x = x, + super(), + // [error column 7, length 5] + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. const C.cc32(int x) - : x = x, - super.named(), -// ^^^^^ -// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST - assert(x == x); -// ^ -// [cfe] Can't have initializers after 'super'. + : x = x, + super.named(), + // [error column 7, length 5] + // [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST + assert(x == x); + // ^ + // [cfe] Can't have initializers after 'super'. } main() { diff --git a/tests/language/variable/ref_before_declaration_runtime_test.dart b/tests/language/variable/ref_before_declaration_runtime_test.dart index 84949d01abd..7a003bf793c 100644 --- a/tests/language/variable/ref_before_declaration_runtime_test.dart +++ b/tests/language/variable/ref_before_declaration_runtime_test.dart @@ -21,7 +21,6 @@ class C { void test1() { use(f); // Refers to instance field f. - } void test2() { @@ -29,7 +28,6 @@ class C { use(f); // Refers to instance field f. } - if (true) { var f = 1; // ok, shadows outer f and instance field f. } @@ -40,19 +38,10 @@ class C { use(x); // Refers to top-level x. use(y); // Refers to top-level y. } - - } void test4() { - void Q() { - - } - - - - - + void Q() {} } test() { @@ -65,12 +54,10 @@ class C { void testTypeRef() { String s = 'Can vegetarians eat animal crackers?'; - } void testLibPrefix() { var pie = math.pi; - } void noErrorsExpected() { diff --git a/tests/language/variable/ref_before_declaration_test.dart b/tests/language/variable/ref_before_declaration_test.dart index dea2a5a43fa..9173482a48d 100644 --- a/tests/language/variable/ref_before_declaration_test.dart +++ b/tests/language/variable/ref_before_declaration_test.dart @@ -57,20 +57,23 @@ class C { void test4() { void Q() { P(); // Refers to non-existing top-level function P -// ^ -// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION -// [cfe] Local variable 'P' can't be referenced before it is declared. -// [cfe] The method 'P' isn't defined for the class 'C'. + // [error column 7, length 1] + // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION + // [cfe] Local variable 'P' can't be referenced before it is declared. + // [cfe] The method 'P' isn't defined for the class 'C'. } + void P() { Q(); } - Function f = () {x = f;}; - // ^ - // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT - // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION - // [cfe] Local variable 'f' can't be referenced before it is declared. + Function f = () { + x = f; + // ^ + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION + // [cfe] Local variable 'f' can't be referenced before it is declared. + }; } test() { @@ -83,9 +86,9 @@ class C { void testTypeRef() { String s = 'Can vegetarians eat animal crackers?'; -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION -// [cfe] Local variable 'String' can't be referenced before it is declared. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION + // [cfe] Local variable 'String' can't be referenced before it is declared. var String = "I distinctly remember forgetting that."; } diff --git a/tests/language/variance/variance_in_field_error_test.dart b/tests/language/variance/variance_in_field_error_test.dart index 172c2e29e59..6e19b9dabd5 100644 --- a/tests/language/variance/variance_in_field_error_test.dart +++ b/tests/language/variance/variance_in_field_error_test.dart @@ -84,8 +84,7 @@ class D extends C { var a; // ^ // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD - // [cfe] Can't use 'in' type variable 'T' in an 'out' position. - // ^ // [analyzer] COMPILE_TIME_ERROR.WRONG_TYPE_PARAMETER_VARIANCE_POSITION + // [cfe] Can't use 'in' type variable 'T' in an 'out' position. // [cfe] Field 'a' should be initialized because its type 'T' doesn't allow null. } diff --git a/tests/language/variance/variance_in_inference_error_test.dart b/tests/language/variance/variance_in_inference_error_test.dart index a4c67b7902d..7341f1cba02 100644 --- a/tests/language/variance/variance_in_inference_error_test.dart +++ b/tests/language/variance/variance_in_inference_error_test.dart @@ -47,41 +47,41 @@ main() { inferCovContra(Covariant(), Contravariant()); //^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER -// [cfe] unspecified // ^^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE +// [cfe] The argument type 'Contravariant' can't be assigned to the parameter type 'Contravariant'. // String <: T <: int is not a valid constraint. inferCovContra(Covariant(), Contravariant()); //^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER -// [cfe] unspecified // ^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE +// [cfe] The argument type 'Contravariant' can't be assigned to the parameter type 'Contravariant'. // Middle <: T <: Lower is not a valid constraint inferCovContra(Covariant(), Contravariant()); //^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER -// [cfe] unspecified // ^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE +// [cfe] The argument type 'Contravariant' can't be assigned to the parameter type 'Contravariant'. // Upper <: T <: Lower is not a valid constraint inferCovContra(Covariant(), Contravariant()); //^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER -// [cfe] unspecified // ^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE +// [cfe] The argument type 'Contravariant' can't be assigned to the parameter type 'Contravariant'. // Upper <: T <: Middle is not a valid constraint inferCovContra(Covariant(), Contravariant()); //^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER -// [cfe] unspecified // ^^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE +// [cfe] The argument type 'Contravariant' can't be assigned to the parameter type 'Contravariant'. // Inference for Contrabound(...) produces Lower <: T <: Upper. // Since T is contravariant, we choose Upper as the solution. diff --git a/tests/language/variance/variance_in_subclass_error_test.dart b/tests/language/variance/variance_in_subclass_error_test.dart index 123b3e56856..76e4468fab9 100644 --- a/tests/language/variance/variance_in_subclass_error_test.dart +++ b/tests/language/variance/variance_in_subclass_error_test.dart @@ -136,9 +136,7 @@ class S = Contravariant with MCovariant; class T = Invariant with MInvariant; // ^ // [cfe] Can't use 'in' type variable 'X' in an 'inout' position in supertype 'Invariant'. -// ^ // [cfe] Can't use 'in' type variable 'X' in an 'inout' position in supertype 'MInvariant'. // ^ // [analyzer] COMPILE_TIME_ERROR.WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE -// ^ // [analyzer] COMPILE_TIME_ERROR.WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE diff --git a/tests/language/vm/allocate_overflow_array_test.dart b/tests/language/vm/allocate_overflow_array_test.dart index 3e66f6737cd..52585a411e0 100644 --- a/tests/language/vm/allocate_overflow_array_test.dart +++ b/tests/language/vm/allocate_overflow_array_test.dart @@ -26,7 +26,9 @@ main() { Expect.throws(() { var array = new List.filled( - interestingLength ~/ elementLength, null); + interestingLength ~/ elementLength, + null, + ); print(array.first); }, (e) => e is OutOfMemoryError); } diff --git a/tests/language/vm/allocation_sinking_arrays_test.dart b/tests/language/vm/allocation_sinking_arrays_test.dart index c6dc0a5c590..db856d3fb41 100644 --- a/tests/language/vm/allocation_sinking_arrays_test.dart +++ b/tests/language/vm/allocation_sinking_arrays_test.dart @@ -85,7 +85,8 @@ main() { final num doDeopt = (i < 120 ? 1 : 2.0); final result = foo(3.0, doDeopt); Expect.equals( - "v1: [1,hi], v2: [1.0,2.0], v3: [4.0,5.0], v4: [11.0, 12.0], sum: 9.0", - result); + "v1: [1,hi], v2: [1.0,2.0], v3: [4.0,5.0], v4: [11.0, 12.0], sum: 9.0", + result, + ); } } diff --git a/tests/language/vm/allocation_sinking_vm_test.dart b/tests/language/vm/allocation_sinking_vm_test.dart index f96fcbdbbdc..c9bd90f0599 100644 --- a/tests/language/vm/allocation_sinking_vm_test.dart +++ b/tests/language/vm/allocation_sinking_vm_test.dart @@ -195,14 +195,15 @@ testCompound1() { for (var i = 0; i < 100; i++) f(0.1); Expect.equals(0.1, f(0.1)); Expect.equals( - 0.1, - f(0.1, (val) { - Expect.isTrue(val is CompoundA); - Expect.isTrue(val.b is CompoundB); - Expect.isTrue(val.b.c is CompoundC); - Expect.isNull(val.b.c.root); - Expect.equals(0.1, val.b.c.d); - })); + 0.1, + f(0.1, (val) { + Expect.isTrue(val is CompoundA); + Expect.isTrue(val.b is CompoundB); + Expect.isTrue(val.b.c is CompoundC); + Expect.isNull(val.b.c.root); + Expect.equals(0.1, val.b.c.d); + }), + ); } testCompound2() { @@ -218,14 +219,15 @@ testCompound2() { for (var i = 0; i < 100; i++) f(0.1); Expect.equals(0.1, f(0.1)); Expect.equals( - 0.1, - f(0.1, (val) { - Expect.isTrue(val is CompoundA); - Expect.isTrue(val.b is CompoundB); - Expect.isTrue(val.b.c is CompoundC); - Expect.equals(val, val.b.c.root); - Expect.equals(0.1, val.b.c.d); - })); + 0.1, + f(0.1, (val) { + Expect.isTrue(val is CompoundA); + Expect.isTrue(val.b is CompoundB); + Expect.isTrue(val.b.c is CompoundC); + Expect.equals(val, val.b.c.root); + Expect.equals(0.1, val.b.c.d); + }), + ); } testCompound3() { @@ -240,12 +242,13 @@ testCompound3() { for (var i = 0; i < 100; i++) f(0.1); Expect.equals(0.1, f(0.1)); Expect.equals( - 0.1, - f(0.1, (val) { - Expect.isTrue(val is CompoundC); - Expect.equals(val, val.root); - Expect.equals(0.1, val.d); - })); + 0.1, + f(0.1, (val) { + Expect.isTrue(val is CompoundC); + Expect.equals(val, val.root); + Expect.equals(0.1, val.d); + }), + ); } testCompound4() { @@ -263,12 +266,13 @@ testCompound4() { for (var i = 0; i < 100; i++) f(1.0); Expect.equals(1.0, f(1.0)); Expect.equals( - 1.0, - f(1.0, (val) { - Expect.isTrue(val is CompoundC); - Expect.equals(val, val.root); - Expect.equals(11.0, val.d); - })); + 1.0, + f(1.0, (val) { + Expect.isTrue(val is CompoundC); + Expect.equals(val, val.root); + Expect.equals(11.0, val.d); + }), + ); } main() { @@ -276,14 +280,19 @@ main() { // Compute initial values. final x0 = test1(c, 11.11, 22.22); - var fc = new Cx4(new Pointx4( - new Float32x4(1.0, 1.0, 1.0, 1.0), new Float32x4(1.0, 1.0, 1.0, 1.0))); + var fc = new Cx4( + new Pointx4( + new Float32x4(1.0, 1.0, 1.0, 1.0), + new Float32x4(1.0, 1.0, 1.0, 1.0), + ), + ); final fx0 = test1x4( - fc, - new Float32x4(1.0, 1.0, 1.0, 1.0), - new Float32x4(1.0, 1.0, 1.0, 1.0), - new Float32x4(1.0, 1.0, 1.0, 1.0), - new Float32x4(1.0, 1.0, 1.0, 1.0)); + fc, + new Float32x4(1.0, 1.0, 1.0, 1.0), + new Float32x4(1.0, 1.0, 1.0, 1.0), + new Float32x4(1.0, 1.0, 1.0, 1.0), + new Float32x4(1.0, 1.0, 1.0, 1.0), + ); final y0 = testForwardingThroughEffects(c, 11.11, 22.22); final z0 = testIdentity(c.p); @@ -291,11 +300,12 @@ main() { for (var i = 0; i < 100; i++) { test1(c, i.toDouble(), i.toDouble()); test1x4( - fc, - new Float32x4(1.0, 1.0, 1.0, 1.0), - new Float32x4(1.0, 1.0, 1.0, 1.0), - new Float32x4(1.0, 1.0, 1.0, 1.0), - new Float32x4(1.0, 1.0, 1.0, 1.0)); + fc, + new Float32x4(1.0, 1.0, 1.0, 1.0), + new Float32x4(1.0, 1.0, 1.0, 1.0), + new Float32x4(1.0, 1.0, 1.0, 1.0), + new Float32x4(1.0, 1.0, 1.0, 1.0), + ); testForwardingThroughEffects(c, i.toDouble(), i.toDouble()); testIdentity(c.p); foo2(); diff --git a/tests/language/vm/clamp_37868_test.dart b/tests/language/vm/clamp_37868_test.dart index 58d3eae4c0e..77d53bc5574 100755 --- a/tests/language/vm/clamp_37868_test.dart +++ b/tests/language/vm/clamp_37868_test.dart @@ -37,10 +37,38 @@ main() { 0, -1, ]; - Expect.listEquals( - [255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 11, 0, 0, 0], foo(x)); - Expect.listEquals( - [255, 0, 1, 255, 0, 0, 255, 0, 255, 1, 11, 245, 0, 255], bar(x)); + Expect.listEquals([ + 255, + 0, + 255, + 0, + 255, + 0, + 255, + 0, + 255, + 0, + 11, + 0, + 0, + 0, + ], foo(x)); + Expect.listEquals([ + 255, + 0, + 1, + 255, + 0, + 0, + 255, + 0, + 255, + 1, + 11, + 245, + 0, + 255, + ], bar(x)); Expect.listEquals([-1, 0, 1, -1, 0, 0, -1, 0, -1, 1, 11, -11, 0, -1], baz(x)); // Hidden null. diff --git a/tests/language/vm/deep_loop_test.dart b/tests/language/vm/deep_loop_test.dart index 92262dbfd8e..b3a88de9ea8 100644 --- a/tests/language/vm/deep_loop_test.dart +++ b/tests/language/vm/deep_loop_test.dart @@ -2,6 +2,8 @@ // 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. +// Don't try to fit in 80 columns with this much nesting. +// dart format width=300 import 'package:expect/expect.dart'; // Stress tests on loop nesting depth. Make sure loop and induction @@ -27,87 +29,27 @@ foo(List a) { for (int i14 = i13 - 1; i14 <= i13 + 1; i14++) for (int i15 = i14 - 1; i15 <= i14 + 1; i15++) for (int i16 = i15 - 1; i16 <= i15 + 1; i16++) - for (int i17 = i16 - 1; - i17 <= i16 + 1; - i17++) - for (int i18 = i17 - 1; - i18 <= i17 + 1; - i18++) - for (int i19 = i18 - 1; - i19 <= i18 + 1; - i19++) - for (int i20 = i19 - 1; - i20 <= i19 + 1; - i20++) - for (int i21 = i20 - 1; - i21 <= i20 + 1; - i21++) - for (int i22 = i21 - 1; - i22 <= i21 + 1; - i22++) - for (int i23 = i22 - 1; - i23 <= i22 + 1; - i23++) - for (int i24 = i23 - 1; - i24 <= i23 + 1; - i24++) - for (int i25 = i24 - 1; - i25 <= i24 + 1; - i25++) - for (int i26 = i25 - 1; - i26 <= i25 + 1; - i26++) - for (int i27 = i26 - 1; - i27 <= i26 + 1; - i27++) - for (int i28 = - i27 - 1; - i28 <= i27 + 1; - i28++) - for (int i29 = - i28 - 1; - i29 <= i28 + 1; - i29++) - for (int i30 = - i29 - 1; - i30 <= - i29 + 1; - i30++) - for (int i31 = - i30 - 1; - i31 <= - i30 + 1; - i31++) - for (int i32 = - i31 - - 1; - i32 <= - i31 + - 1; - i32++) - for (int i33 = - i32 - - 1; - i33 <= - i32 + - 1; - i33++) - for (int i34 = i33 - - 1; - i34 <= - i33 + 1; - i34++) - for (int i35 = i34 - - 1; - i35 <= - i34 + 1; - i35++) - for (int i36 = i35 - 1; - i36 <= i35 + 1; - i36++) - for (int i37 = i36 - 1; - i37 <= i36 + 1; - i37++) + for (int i17 = i16 - 1; i17 <= i16 + 1; i17++) + for (int i18 = i17 - 1; i18 <= i17 + 1; i18++) + for (int i19 = i18 - 1; i19 <= i18 + 1; i19++) + for (int i20 = i19 - 1; i20 <= i19 + 1; i20++) + for (int i21 = i20 - 1; i21 <= i20 + 1; i21++) + for (int i22 = i21 - 1; i22 <= i21 + 1; i22++) + for (int i23 = i22 - 1; i23 <= i22 + 1; i23++) + for (int i24 = i23 - 1; i24 <= i23 + 1; i24++) + for (int i25 = i24 - 1; i25 <= i24 + 1; i25++) + for (int i26 = i25 - 1; i26 <= i25 + 1; i26++) + for (int i27 = i26 - 1; i27 <= i26 + 1; i27++) + for (int i28 = i27 - 1; i28 <= i27 + 1; i28++) + for (int i29 = i28 - 1; i29 <= i28 + 1; i29++) + for (int i30 = i29 - 1; i30 <= i29 + 1; i30++) + for (int i31 = i30 - 1; i31 <= i30 + 1; i31++) + for (int i32 = i31 - 1; i32 <= i31 + 1; i32++) + for (int i33 = i32 - 1; i33 <= i32 + 1; i33++) + for (int i34 = i33 - 1; i34 <= i33 + 1; i34++) + for (int i35 = i34 - 1; i35 <= i34 + 1; i35++) + for (int i36 = i35 - 1; i36 <= i35 + 1; i36++) + for (int i37 = i36 - 1; i37 <= i36 + 1; i37++) for (int i38 = i37 - 1; i38 <= i37 + 1; i38++) for (int i39 = i38 - 1; i39 <= i38 + 1; i39++) for (int i40 = i39 - 1; i40 <= i39 + 1; i40++) @@ -195,87 +137,27 @@ bar(List a) { for (int i14 = i13 + 1; i14 >= i13 - 1; i14--) for (int i15 = i14 + 1; i15 >= i14 - 1; i15--) for (int i16 = i15 + 1; i16 >= i15 - 1; i16--) - for (int i17 = i16 + 1; - i17 >= i16 - 1; - i17--) - for (int i18 = i17 + 1; - i18 >= i17 - 1; - i18--) - for (int i19 = i18 + 1; - i19 >= i18 - 1; - i19--) - for (int i20 = i19 + 1; - i20 >= i19 - 1; - i20--) - for (int i21 = i20 + 1; - i21 >= i20 - 1; - i21--) - for (int i22 = i21 + 1; - i22 >= i21 - 1; - i22--) - for (int i23 = i22 + 1; - i23 >= i22 - 1; - i23--) - for (int i24 = i23 + 1; - i24 >= i23 - 1; - i24--) - for (int i25 = i24 + 1; - i25 >= i24 - 1; - i25--) - for (int i26 = i25 + 1; - i26 >= i25 - 1; - i26--) - for (int i27 = i26 + 1; - i27 >= i26 - 1; - i27--) - for (int i28 = - i27 + 1; - i28 >= i27 - 1; - i28--) - for (int i29 = - i28 + 1; - i29 >= i28 - 1; - i29--) - for (int i30 = - i29 + 1; - i30 >= - i29 - 1; - i30--) - for (int i31 = - i30 + 1; - i31 >= - i30 - 1; - i31--) - for (int i32 = - i31 + - 1; - i32 >= - i31 - - 1; - i32--) - for (int i33 = - i32 + - 1; - i33 >= - i32 - - 1; - i33--) - for (int i34 = i33 + - 1; - i34 >= - i33 - 1; - i34--) - for (int i35 = i34 + - 1; - i35 >= - i34 - 1; - i35--) - for (int i36 = i35 + 1; - i36 >= i35 - 1; - i36--) - for (int i37 = i36 + 1; - i37 >= i36 - 1; - i37--) + for (int i17 = i16 + 1; i17 >= i16 - 1; i17--) + for (int i18 = i17 + 1; i18 >= i17 - 1; i18--) + for (int i19 = i18 + 1; i19 >= i18 - 1; i19--) + for (int i20 = i19 + 1; i20 >= i19 - 1; i20--) + for (int i21 = i20 + 1; i21 >= i20 - 1; i21--) + for (int i22 = i21 + 1; i22 >= i21 - 1; i22--) + for (int i23 = i22 + 1; i23 >= i22 - 1; i23--) + for (int i24 = i23 + 1; i24 >= i23 - 1; i24--) + for (int i25 = i24 + 1; i25 >= i24 - 1; i25--) + for (int i26 = i25 + 1; i26 >= i25 - 1; i26--) + for (int i27 = i26 + 1; i27 >= i26 - 1; i27--) + for (int i28 = i27 + 1; i28 >= i27 - 1; i28--) + for (int i29 = i28 + 1; i29 >= i28 - 1; i29--) + for (int i30 = i29 + 1; i30 >= i29 - 1; i30--) + for (int i31 = i30 + 1; i31 >= i30 - 1; i31--) + for (int i32 = i31 + 1; i32 >= i31 - 1; i32--) + for (int i33 = i32 + 1; i33 >= i32 - 1; i33--) + for (int i34 = i33 + 1; i34 >= i33 - 1; i34--) + for (int i35 = i34 + 1; i35 >= i34 - 1; i35--) + for (int i36 = i35 + 1; i36 >= i35 - 1; i36--) + for (int i37 = i36 + 1; i37 >= i36 - 1; i37--) for (int i38 = i37 + 1; i38 >= i37 - 1; i38--) for (int i39 = i38 + 1; i39 >= i38 - 1; i39--) for (int i40 = i39 + 1; i40 >= i39 - 1; i40--) diff --git a/tests/language/vm/fuzzer_unsigned_shift_right_test.dart b/tests/language/vm/fuzzer_unsigned_shift_right_test.dart index 42660edcfe7..97eb1f8e078 100644 --- a/tests/language/vm/fuzzer_unsigned_shift_right_test.dart +++ b/tests/language/vm/fuzzer_unsigned_shift_right_test.dart @@ -15,8 +15,9 @@ Int16List? foo0_0(int par4) { return Int16List(40); } for (int loc0 = 0; loc0 < 31; loc0++) { - for (int loc1 in ((Uint8ClampedList.fromList(Uint8List(26))) - .sublist((11 >>> loc0), null))) {} + for (int loc1 in ((Uint8ClampedList.fromList( + Uint8List(26), + )).sublist((11 >>> loc0), null))) {} } return foo0_0(par4 + 1); } diff --git a/tests/language/vm/lazy_async_exception_stack2_test.dart b/tests/language/vm/lazy_async_exception_stack2_test.dart index 8b3a24cf564..f312485e4e2 100644 --- a/tests/language/vm/lazy_async_exception_stack2_test.dart +++ b/tests/language/vm/lazy_async_exception_stack2_test.dart @@ -27,13 +27,9 @@ test1() async { } catch (e, st) { // st has foo,2,3 and not bar,2,3. expect( - h.stringContainsInOrder(st.toString(), [ - 'foo3', - 'foo2', - 'foo', - 'test1', - ]), - isTrue); + h.stringContainsInOrder(st.toString(), ['foo3', 'foo2', 'foo', 'test1']), + isTrue, + ); expect(st.toString().contains('bar'), isFalse); } @@ -42,13 +38,9 @@ test1() async { } catch (e, st) { // st has bar,2,3 but not foo,2,3 expect( - h.stringContainsInOrder(st.toString(), [ - 'bar3', - 'bar2', - 'bar', - 'test1', - ]), - isTrue); + h.stringContainsInOrder(st.toString(), ['bar3', 'bar2', 'bar', 'test1']), + isTrue, + ); expect(st.toString().contains('foo'), isFalse); } } @@ -64,13 +56,9 @@ test2() async { } catch (e, st) { // st has foo,2,3 but not bar,2,3 expect( - h.stringContainsInOrder(st.toString(), [ - 'foo3', - 'foo2', - 'foo', - 'test2', - ]), - isTrue); + h.stringContainsInOrder(st.toString(), ['foo3', 'foo2', 'foo', 'test2']), + isTrue, + ); expect(st.toString().contains('bar'), isFalse); } @@ -79,13 +67,9 @@ test2() async { } catch (e, st) { // st has bar,2,3 but not foo,2,3 expect( - h.stringContainsInOrder(st.toString(), [ - 'bar3', - 'bar2', - 'bar', - 'test2', - ]), - isTrue); + h.stringContainsInOrder(st.toString(), ['bar3', 'bar2', 'bar', 'test2']), + isTrue, + ); expect(st.toString().contains('foo'), isFalse); } } diff --git a/tests/language/vm/lazy_async_exception_stack_test.dart b/tests/language/vm/lazy_async_exception_stack_test.dart index ad088a7a590..9937779f441 100644 --- a/tests/language/vm/lazy_async_exception_stack_test.dart +++ b/tests/language/vm/lazy_async_exception_stack_test.dart @@ -33,14 +33,15 @@ main() async { fail("Did not throw"); } catch (e, st) { expect( - h.stringContainsInOrder(st.toString(), [ - 'thrower', '.dart:10', // no auto-format. - 'generator', '.dart:19', // no auto-format. - '', // no auto-format. - 'foo', '.dart', // no auto-format. - 'main', - ]), - isTrue); + h.stringContainsInOrder(st.toString(), [ + 'thrower', '.dart:10', // no auto-format. + 'generator', '.dart:19', // no auto-format. + '', // no auto-format. + 'foo', '.dart', // no auto-format. + 'main', + ]), + isTrue, + ); } inner() async { @@ -56,14 +57,15 @@ main() async { await inner(); } catch (e, st) { expect( - h.stringContainsInOrder(st.toString(), [ - 'thrower', - 'main..inner.deep', - 'main..inner', - 'main', - '', - ]), - isTrue); + h.stringContainsInOrder(st.toString(), [ + 'thrower', + 'main..inner.deep', + 'main..inner', + 'main', + '', + ]), + isTrue, + ); } // Test for correct linkage. @@ -71,11 +73,12 @@ main() async { await thrower(); } catch (e, st) { expect( - h.stringContainsInOrder(st.toString(), [ - 'thrower', '.dart:10', // no auto-format. - 'main.', '.dart:71', // no auto-format. - ]), - isTrue); + h.stringContainsInOrder(st.toString(), [ + 'thrower', '.dart:10', // no auto-format. + 'main.', '.dart:73', // no auto-format. + ]), + isTrue, + ); } }); } diff --git a/tests/language/vm/load_to_load_forwarding_vm_test.dart b/tests/language/vm/load_to_load_forwarding_vm_test.dart index 69c830dd44b..038ce1c90e2 100644 --- a/tests/language/vm/load_to_load_forwarding_vm_test.dart +++ b/tests/language/vm/load_to_load_forwarding_vm_test.dart @@ -189,9 +189,7 @@ testPhiForwarding5(C c) { class U { var x, y; - U() - : x = 0, - y = 0; + U() : x = 0, y = 0; } testEqualPhisElimination() { diff --git a/tests/language/vm/no_such_args_error_message_vm_test.dart b/tests/language/vm/no_such_args_error_message_vm_test.dart index 22632091874..ca5084c5b26 100644 --- a/tests/language/vm/no_such_args_error_message_vm_test.dart +++ b/tests/language/vm/no_such_args_error_message_vm_test.dart @@ -17,8 +17,9 @@ testClosureMessage() { // The latter may happen if in --dwarf-stack-traces mode. final possibleNames = ['testClosureMessage', '']; Expect.containsAny( - possibleNames.map((s) => s + '.("bar")').toList(), - e.toString()); + possibleNames.map((s) => s + '.("bar")').toList(), + e.toString(), + ); } } @@ -28,9 +29,7 @@ testFunctionMessage() { try { call_with_bar(noargs); } catch (e) { - final expectedStrings = [ - 'Tried calling: noargs("bar")', - ]; + final expectedStrings = ['Tried calling: noargs("bar")']; Expect.containsInOrder(expectedStrings, e.toString()); } } diff --git a/tests/language/vm/osr_nonempty_stack_test.dart b/tests/language/vm/osr_nonempty_stack_test.dart index a31df5097cb..e3f7afc0023 100644 --- a/tests/language/vm/osr_nonempty_stack_test.dart +++ b/tests/language/vm/osr_nonempty_stack_test.dart @@ -74,9 +74,12 @@ List test3(int n) { // leaves the stack non-empty during a potential OSR. @pragma('vm:never-inline') List test4(int n) { - var x = [10] + - z.check(42, bazz(), 'abc', - [more_bazz(), for (int i = 0; i < n; i++) bar(2 * i)]); + var x = + [10] + + z.check(42, bazz(), 'abc', [ + more_bazz(), + for (int i = 0; i < n; i++) bar(2 * i), + ]); return x; } @@ -86,9 +89,12 @@ List test4(int n) { List test5(int m, int n) { List x = []; for (int k = 0; k < m; k++) { - x += [10] + - z.check(42, bazz(), 'abc', - [more_bazz(), for (int i = 0; i < n; i++) bar(2 * i)]); + x += + [10] + + z.check(42, bazz(), 'abc', [ + more_bazz(), + for (int i = 0; i < n; i++) bar(2 * i), + ]); } return x; } @@ -96,7 +102,7 @@ List test5(int m, int n) { List globalList = [ 1, for (int loc1 = 2; loc1 <= 100000; loc1++) loc1, - 100001 + 100001, ]; main() { diff --git a/tests/language/vm/reflect_core_vm_test.dart b/tests/language/vm/reflect_core_vm_test.dart index 40d679307cc..b03e2f321ee 100644 --- a/tests/language/vm/reflect_core_vm_test.dart +++ b/tests/language/vm/reflect_core_vm_test.dart @@ -10,7 +10,10 @@ import "dart:mirrors"; main() { var s = "string"; var im = reflect(s); - Expect.throwsNoSuchMethodError(() => - im.invoke(MirrorSystem.getSymbol( - "_setAt", im.type.owner as LibraryMirror), [0, 65])); + Expect.throwsNoSuchMethodError( + () => im.invoke( + MirrorSystem.getSymbol("_setAt", im.type.owner as LibraryMirror), + [0, 65], + ), + ); } diff --git a/tests/language/vm/regress_35325_test.dart b/tests/language/vm/regress_35325_test.dart index 51b1122c800..04d5fef562d 100644 --- a/tests/language/vm/regress_35325_test.dart +++ b/tests/language/vm/regress_35325_test.dart @@ -18,10 +18,9 @@ bar(List par1, double par2) { bool foo(double par1) { return (bar( - [81, 17], - ((!(var1)) - ? double.maxFinite - : (var1 ? (80).floorToDouble() : par1))) == + [81, 17], + ((!(var1)) ? double.maxFinite : (var1 ? (80).floorToDouble() : par1)), + ) == (((~(var2))).roundToDouble()).sign); } diff --git a/tests/language/vm/regress_37149_test.dart b/tests/language/vm/regress_37149_test.dart index 680c0657b42..bcc9dc98810 100644 --- a/tests/language/vm/regress_37149_test.dart +++ b/tests/language/vm/regress_37149_test.dart @@ -9,12 +9,18 @@ import 'dart:async' show FutureOr; typedef ComputeCallback = FutureOr Function(Q message); -typedef _ComputeImpl = Future Function( - ComputeCallback? callback, Q? message, - {String debugLabel}); +typedef _ComputeImpl = + Future Function( + ComputeCallback? callback, + Q? message, { + String debugLabel, + }); -Future isolatesCompute(ComputeCallback? callback, Q? message, - {String? debugLabel}) async { +Future isolatesCompute( + ComputeCallback? callback, + Q? message, { + String? debugLabel, +}) async { return null; } diff --git a/tests/language/vm/regress_45260_test.dart b/tests/language/vm/regress_45260_test.dart index d4fb0c53770..d0ce355c60b 100644 --- a/tests/language/vm/regress_45260_test.dart +++ b/tests/language/vm/regress_45260_test.dart @@ -15,10 +15,10 @@ List>>> toNestedList() { for (var i2 = 0; i2 < 2; i2++) [ for (var i3 = 0; i3 < 2; i3++) - 1000 * i0 + 100 * i1 + 10 * i2 + i3 - ] - ] - ] + 1000 * i0 + 100 * i1 + 10 * i2 + i3, + ], + ], + ], ]; return list; } @@ -32,7 +32,7 @@ const expectedList = [ [ [0100, 0101], [0110, 0111], - ] + ], ], [ [ @@ -42,8 +42,8 @@ const expectedList = [ [ [1100, 1101], [1110, 1111], - ] - ] + ], + ], ]; void main() { diff --git a/tests/language/vm/regress_b131091988_test.dart b/tests/language/vm/regress_b131091988_test.dart index 359b4febe19..42e7b8f44bf 100644 --- a/tests/language/vm/regress_b131091988_test.dart +++ b/tests/language/vm/regress_b131091988_test.dart @@ -11,7 +11,8 @@ abstract class A { } class B extends A { - int Function(List raw) get decode => (List raw) => raw.first; + int Function(List raw) get decode => + (List raw) => raw.first; } class C { diff --git a/tests/language/vm/regress_flutter_14891_test.dart b/tests/language/vm/regress_flutter_14891_test.dart index 1f410df010e..03b4b2e06dc 100644 --- a/tests/language/vm/regress_flutter_14891_test.dart +++ b/tests/language/vm/regress_flutter_14891_test.dart @@ -10,6 +10,7 @@ import "package:expect/expect.dart"; class _ClassOnlyUsedAsTypeLiteral {} void main() { - Expect - .isTrue((const [_ClassOnlyUsedAsTypeLiteral]).toString().startsWith('[')); + Expect.isTrue( + (const [_ClassOnlyUsedAsTypeLiteral]).toString().startsWith('['), + ); } diff --git a/tests/language/vm/regress_flutter_23879_test.dart b/tests/language/vm/regress_flutter_23879_test.dart index 27d6f263107..0bc6d96b0f1 100644 --- a/tests/language/vm/regress_flutter_23879_test.dart +++ b/tests/language/vm/regress_flutter_23879_test.dart @@ -10,8 +10,18 @@ import "package:expect/expect.dart"; List list = new List.filled(10, null); -List expected_values = - [null, 152, 168, 184, 200, 216, 232, 248, 264, 280]; +List expected_values = [ + null, + 152, + 168, + 184, + 200, + 216, + 232, + 248, + 264, + 280, +]; int count = 0; diff --git a/tests/language/vm/regress_flutter_89584_test.dart b/tests/language/vm/regress_flutter_89584_test.dart index 2dd0e3e6d7f..fee541f539c 100644 --- a/tests/language/vm/regress_flutter_89584_test.dart +++ b/tests/language/vm/regress_flutter_89584_test.dart @@ -21,9 +21,7 @@ const uint8ListLength = 1000000; void isolateEntry(SendPort sendPort) async { final uint8list = Uint8List(uint8ListLength); - sendPort.send(Wrapper( - uint8list.buffer.asUint8List(0, uint8list.length), - )); + sendPort.send(Wrapper(uint8list.buffer.asUint8List(0, uint8list.length))); } int readWrapperUint8ListView(Wrapper wrapper) { diff --git a/tests/language/vm/regress_licm_test.dart b/tests/language/vm/regress_licm_test.dart index 1855c158e6a..7776aace330 100644 --- a/tests/language/vm/regress_licm_test.dart +++ b/tests/language/vm/regress_licm_test.dart @@ -62,7 +62,7 @@ main() { new Member(new BName("a")), new Member(new BName("b")), new Member(new BName("c")), - new Member(new BName("d")) + new Member(new BName("d")), ]; find(list, new AName()); diff --git a/tests/language/vm/regression_36587_test.dart b/tests/language/vm/regression_36587_test.dart index 595327b7c5c..ac6910eef6c 100644 --- a/tests/language/vm/regression_36587_test.dart +++ b/tests/language/vm/regression_36587_test.dart @@ -32,7 +32,7 @@ Map var9 = { 99: 't', 49: 'Qu', 20: 'FujA\u2665', - 47: '' + 47: '', }; String? foo2() { @@ -55,22 +55,25 @@ String? foo2() { : { (var4++), (var7[(false ? -87 : (++loc0))] % - (var7[((++loc0) * var4)] ~/ 73)) + (var7[((++loc0) * var4)] ~/ 73)), }); - var0 = ((((-((((true ? var2 : false) ? (!(var3)) : true) + var0 = + ((((-((((true ? var2 : false) ? (!(var3)) : true) ? var5 : ((0.38834735336907733 as dynamic) ?? - 0.8105736840461367)))) + + 0.8105736840461367)))) + (0.3752597438445757).abs())) .isFinite ? { (true ? 65 : (var3 ? (loc0--) : var4)), - var7[Float32x4.xxxx] + var7[Float32x4.xxxx], } : Set.identity()); - var1 = (((true - ? ({var7[var7[-9223372032559808513]]}).toSet() - : (Set.identity()).difference(var8!)) as dynamic) ?? + var1 = + (((true + ? ({var7[var7[-9223372032559808513]]}).toSet() + : (Set.identity()).difference(var8!)) + as dynamic) ?? var8); var9[Float32x4.zxyz] = ''; } catch (e) { @@ -86,7 +89,7 @@ String? foo2() { (var4--), (-(ZLibOption.defaultWindowBits)), (~((loc0--))), - (var4++) + (var4++), ]; } } diff --git a/tests/language/vm/regression_38231_legacy_test.dart b/tests/language/vm/regression_38231_legacy_test.dart index cab6d2be29b..77551337cba 100644 --- a/tests/language/vm/regression_38231_legacy_test.dart +++ b/tests/language/vm/regression_38231_legacy_test.dart @@ -26,7 +26,10 @@ import 'dart:typed_data'; Map var0 = { 41: 'V\u2665Y\u2665#Xs', for (int loc0 in { - if (true) for (int loc0 in {-2147483649}) -4294967167 else if (false) -1, + if (true) + for (int loc0 in {-2147483649}) -4294967167 + else if (false) + -1, -60, -82, -21, @@ -40,7 +43,8 @@ Map var0 = { }) 95: '', 5: 'z2\u2665e', - if (false) for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3', + if (false) + for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3', 22: '' }; String var1 = ')LIpwG'; diff --git a/tests/language/vm/regression_38231_test.dart b/tests/language/vm/regression_38231_test.dart index 3c7475d4e1d..bc01f1d4c4e 100644 --- a/tests/language/vm/regression_38231_test.dart +++ b/tests/language/vm/regression_38231_test.dart @@ -24,22 +24,26 @@ import 'dart:typed_data'; Map var0 = { 41: 'V\u2665Y\u2665#Xs', for (int loc0 in { - if (true) for (int loc0 in {-2147483649}) -4294967167 else if (false) -1, + if (true) + for (int loc0 in {-2147483649}) -4294967167 + else if (false) + -1, -60, -82, -21, for (int loc0 in [ -9223372036854771712, - for (int loc0 = 0; loc0 < 53; loc0++) 96 + for (int loc0 = 0; loc0 < 53; loc0++) 96, ]) 1, -58, - 77 + 77, }) 95: '', 5: 'z2\u2665e', - if (false) for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3', - 22: '' + if (false) + for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3', + 22: '', }; String var1 = ')LIpwG'; double var2 = 0.30016980633333135; @@ -60,14 +64,14 @@ Set var9 = { -26, -38, 9223372032559808513, - 60 + 60, }) for (int loc1 in { for (int loc1 in {19, 60}) -4294967280, -17, - -62 + -62, }) ...{23, 11}, - for (int loc0 = 0; loc0 < 30; loc0++) -44 + for (int loc0 = 0; loc0 < 30; loc0++) -44, }; Map var10 = { for (int loc0 in { @@ -77,18 +81,18 @@ Map var10 = { if (true) 82, ...{76, 5, 9223372032559841279, 98, 58, 97, -127, 72}, for (int loc0 in [-97]) -14, - for (int loc0 = 0; loc0 < 21; loc0++) 88 + for (int loc0 = 0; loc0 < 21; loc0++) 88, }, -52, for (int loc0 = 0; loc0 < 63; loc0++) ...{64, 0}, - for (int loc0 = 0; loc0 < 67; loc0++) ...{67} + for (int loc0 = 0; loc0 < 67; loc0++) ...{67}, }) 54: '', 41: 'cvokV0', 4: '9\u2665', 35: 'vRkv', 41: '\u2665', - 63: 'Nu+u\u26659S' + 63: 'Nu+u\u26659S', }; mixin class X0 {} @@ -108,18 +112,19 @@ main() { } try { X1().foo1_1( - { - 32, - -94, - -2147483649, - -43, - for (int loc0 in {56, -31}) -9223372032559775745, - 53, - 86, - 4294967296 - }, - var4, - {1, 2}); + { + 32, + -94, + -2147483649, + -43, + for (int loc0 in {56, -31}) -9223372032559775745, + 53, + 86, + 4294967296, + }, + var4, + {1, 2}, + ); } catch (exception, stackTrace) { print('X1().foo1_1() throws'); } diff --git a/tests/language/vm/regression_38412_test.dart b/tests/language/vm/regression_38412_test.dart index b904f05945e..1f3e8084508 100644 --- a/tests/language/vm/regression_38412_test.dart +++ b/tests/language/vm/regression_38412_test.dart @@ -34,7 +34,8 @@ main() { "a" == Uri.parse("\u2665"); } print('fuzzvar8 runtime type: ${fuzzvar8.runtimeType}'); - var x = - X1().foo1_0([for (int i = 0; i < 10; ++i) 0], bar(fuzzvar8, --fuzzvar1)); + var x = X1().foo1_0([ + for (int i = 0; i < 10; ++i) 0, + ], bar(fuzzvar8, --fuzzvar1)); Expect.equals(1, x[0]); } diff --git a/tests/language/vm/regression_39071_test.dart b/tests/language/vm/regression_39071_test.dart index 82049b48382..ca748ad9eb7 100644 --- a/tests/language/vm/regression_39071_test.dart +++ b/tests/language/vm/regression_39071_test.dart @@ -9,6 +9,6 @@ main() { var x = [ - [for (int i = 0; i < 20; ++i) i] + [for (int i = 0; i < 20; ++i) i], ]; } diff --git a/tests/language/vm/regression_39193_test.dart b/tests/language/vm/regression_39193_test.dart index bf487652c3c..97fecea702c 100644 --- a/tests/language/vm/regression_39193_test.dart +++ b/tests/language/vm/regression_39193_test.dart @@ -10,7 +10,8 @@ Map> var75 = {}; main() { - try {} catch (e, st) {} finally { + try {} catch (e, st) { + } finally { print('before'); var75[42] = (false ? const {} diff --git a/tests/language/vm/smi_widening_test.dart b/tests/language/vm/smi_widening_test.dart index 5d676996513..86cf0746e7f 100644 --- a/tests/language/vm/smi_widening_test.dart +++ b/tests/language/vm/smi_widening_test.dart @@ -56,19 +56,21 @@ class Box { final int _value; @pragma('vm:never-inline') - Box( - {int days = 0, - int hours = 0, - int minutes = 0, - int seconds = 0, - int milliseconds = 0, - int microseconds = 0}) - : this._microseconds(1000 * 1000 * 60 * 60 * 24 * days + - 1000 * 1000 * 60 * 60 * hours + - 1000 * 1000 * 60 * minutes + - 1000 * 1000 * seconds + - 1000 * milliseconds + - microseconds); + Box({ + int days = 0, + int hours = 0, + int minutes = 0, + int seconds = 0, + int milliseconds = 0, + int microseconds = 0, + }) : this._microseconds( + 1000 * 1000 * 60 * 60 * 24 * days + + 1000 * 1000 * 60 * 60 * hours + + 1000 * 1000 * 60 * minutes + + 1000 * 1000 * seconds + + 1000 * milliseconds + + microseconds, + ); Box._microseconds(this._value); diff --git a/tests/language/vm/type_cast_vm_test.dart b/tests/language/vm/type_cast_vm_test.dart index 50b30c4591c..5edfc3e8577 100644 --- a/tests/language/vm/type_cast_vm_test.dart +++ b/tests/language/vm/type_cast_vm_test.dart @@ -6,7 +6,10 @@ import "package:expect/expect.dart"; checkSecondFunction( - String expectedFileAndLine, int expectedColum, StackTrace stacktrace) { + String expectedFileAndLine, + int expectedColum, + StackTrace stacktrace, +) { var topLine = stacktrace.toString().split("\n")[0]; int startPos = topLine.lastIndexOf("/"); int endPos = topLine.lastIndexOf(")"); @@ -31,7 +34,10 @@ class TypeTest { Expect.isTrue(msg.contains("int")); // dstType Expect.isTrue(msg.contains("String")); // srcType checkSecondFunction( - "type_cast_vm_test.dart:26", 23, (error as dynamic).stackTrace); + "type_cast_vm_test.dart:29", + 23, + (error as dynamic).stackTrace, + ); } return result; } @@ -69,7 +75,10 @@ class TypeTest { Expect.isTrue(msg.contains("int")); // dstType Expect.isTrue(msg.contains("String")); // srcType checkSecondFunction( - "type_cast_vm_test.dart:64", 25, (error as dynamic).stackTrace); + "type_cast_vm_test.dart:70", + 25, + (error as dynamic).stackTrace, + ); } return result; } @@ -89,7 +98,10 @@ class TypeTest { Expect.isTrue(msg.contains("int")); // dstType Expect.isTrue(msg.contains("String")); // srcType checkSecondFunction( - "type_cast_vm_test.dart:80", 16, (error as dynamic).stackTrace); + "type_cast_vm_test.dart:89", + 16, + (error as dynamic).stackTrace, + ); } return result; } @@ -107,7 +119,10 @@ class TypeTest { Expect.isTrue(msg.contains("int")); // dstType Expect.isTrue(msg.contains("String")); // srcType checkSecondFunction( - "type_cast_vm_test.dart:103", 13, (error as dynamic).stackTrace); + "type_cast_vm_test.dart:115", + 13, + (error as dynamic).stackTrace, + ); } return result; } @@ -126,7 +141,10 @@ class TypeTest { Expect.isTrue(msg.contains("int")); // dstType Expect.isTrue(msg.contains("() => Null")); // srcType checkSecondFunction( - "type_cast_vm_test.dart:122", 17, (error as dynamic).stackTrace); + "type_cast_vm_test.dart:137", + 17, + (error as dynamic).stackTrace, + ); } return result; } diff --git a/tests/language/vm/unregistered_closure_in_finally_test.dart b/tests/language/vm/unregistered_closure_in_finally_test.dart index fa970af2fff..c9c3d7eeabd 100644 --- a/tests/language/vm/unregistered_closure_in_finally_test.dart +++ b/tests/language/vm/unregistered_closure_in_finally_test.dart @@ -17,7 +17,9 @@ maybeThrow(bool doThrow) { @pragma('vm:never-inline') run(action) { - try { action(); } catch(e) {} + try { + action(); + } catch (e) {} } test(bool doThrow) { @@ -25,12 +27,16 @@ test(bool doThrow) { maybeThrow(doThrow); } finally { run(() { - doSomething(); // Should not crash here. + doSomething(); // Should not crash here. }); } } main() { - try { test(true); } catch(e) {} - try { test(false); } catch(e) {} + try { + test(true); + } catch (e) {} + try { + test(false); + } catch (e) {} } diff --git a/tests/language/void/await_void_error_test.dart b/tests/language/void/await_void_error_test.dart index fb52fdac584..52cbba0895a 100644 --- a/tests/language/void/await_void_error_test.dart +++ b/tests/language/void/await_void_error_test.dart @@ -12,25 +12,25 @@ FutureOr fov; void main() async { await print(''); - // ^ - // [analyzer] unspecified + // ^^^^^ + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] This expression has type 'void' and can't be used. await v; // ^ - // [analyzer] unspecified + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] This expression has type 'void' and can't be used. await vs[0]; - // ^ - // [analyzer] unspecified + // ^^^^^ + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // ^ // [cfe] This expression has type 'void' and can't be used. var v2 = vs[0]; await v2; - // ^ - // [analyzer] unspecified + // ^^ + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] This expression has type 'void' and can't be used. // A `FutureOr` can be awaited. diff --git a/tests/language/void/generalized_void_usage_test.dart b/tests/language/void/generalized_void_usage_test.dart index 13bb717818f..74c285604bd 100644 --- a/tests/language/void/generalized_void_usage_test.dart +++ b/tests/language/void/generalized_void_usage_test.dart @@ -17,7 +17,7 @@ main() { // In the initialization and increment expressions of a for-loop, // `for (e1; e2; e3) {..}`, `e1` and `e3` may have type void. - for (x;; x) { + for (x; ; x) { break; } diff --git a/tests/language/void/return_future_future_or_void_sync_error1_test.dart b/tests/language/void/return_future_future_or_void_sync_error1_test.dart index 604bd3525ed..034ea815f55 100644 --- a/tests/language/void/return_future_future_or_void_sync_error1_test.dart +++ b/tests/language/void/return_future_future_or_void_sync_error1_test.dart @@ -11,7 +11,7 @@ void main() { // Testing that a block bodied function may not have an empty return Future> test() { return; -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.RETURN_WITHOUT_VALUE -// [cfe] A value must be explicitly returned from a non-void function. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.RETURN_WITHOUT_VALUE + // [cfe] A value must be explicitly returned from a non-void function. } diff --git a/tests/language/void/return_future_or_future_or_void_sync_test.dart b/tests/language/void/return_future_or_future_or_void_sync_test.dart index 1ccb54f3804..ecb9ab506e3 100644 --- a/tests/language/void/return_future_or_future_or_void_sync_test.dart +++ b/tests/language/void/return_future_or_future_or_void_sync_test.dart @@ -47,5 +47,6 @@ FutureOr> test6() { // values, because `Future` is a subtype of `void`. FutureOr> test() { return Future>>.value( - Future>.value(Future.value(null))); + Future>.value(Future.value(null)), + ); } diff --git a/tests/language/void/void_type_usage_test.dart b/tests/language/void/void_type_usage_test.dart index 3c492896284..ce386c265c4 100644 --- a/tests/language/void/void_type_usage_test.dart +++ b/tests/language/void/void_type_usage_test.dart @@ -35,16 +35,16 @@ Object? testVoidParam(void x) { // [cfe] This expression has type 'void' and can't be used. x is Object?; // param_is -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. throw x; // param_throw // ^ // [analyzer] COMPILE_TIME_ERROR.THROW_OF_INVALID_TYPE // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT - // [cfe] This expression has type 'void' and can't be used. // [cfe] Can't throw a value of 'void' since it is neither dynamic nor non-nullable. + // [cfe] This expression has type 'void' and can't be used. [x]; // param_literal_void_list_init: ok @@ -68,9 +68,9 @@ Object? testVoidParam(void x) { // [cfe] This expression has type 'void' and can't be used. x ?? 499; // param_null_equals1 -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. null ?? x; // param_null_equals2: ok @@ -101,26 +101,26 @@ Object? testVoidParam(void x) { for (x in [1, 2]) {} // param_for_in2: ok x += 1; // param_plus_eq -//^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3] + // [cfe] This expression has type 'void' and can't be used. //^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] The operator '+' isn't defined for the class 'void'. x.toString(); // param_toString -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x?.toString(); // param_null_dot -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x..toString(); // param_cascade -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. if (x) {} // param_conditional_stmt // ^ @@ -128,14 +128,14 @@ Object? testVoidParam(void x) { // [cfe] This expression has type 'void' and can't be used. !x; // param_boolean_negation -// ^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 4, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x && true; // param_boolean_and_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true && x; // param_boolean_and_right // ^ @@ -143,9 +143,9 @@ Object? testVoidParam(void x) { // [cfe] This expression has type 'void' and can't be used. x || true; // param_boolean_or_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true || x; // param_boolean_or_right // ^ @@ -153,9 +153,9 @@ Object? testVoidParam(void x) { // [cfe] This expression has type 'void' and can't be used. x == 3; // param_equals_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. 3 == x; // param_equals_right // ^ @@ -178,19 +178,19 @@ Object? testVoidParam(void x) { // [cfe] This expression has type 'void' and can't be used. -x; // param_negation -//^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] The operator 'unary-' isn't defined for the class 'void'. -// ^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] The operator 'unary-' isn't defined for the class 'void'. + // [error column 4, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x(3); // param_use_as_function -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. -// ^ -// [cfe] The method 'call' isn't defined for the class 'void'. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. + // [error column 4] + // [cfe] The method 'call' isn't defined for the class 'void'. "hello$x"; // param_use_in_string_interpolation // ^ @@ -198,8 +198,8 @@ Object? testVoidParam(void x) { // [cfe] This expression has type 'void' and can't be used. x ??= 3; // param_use_in_conditional_assignment_left -//^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3] + // [cfe] This expression has type 'void' and can't be used. //^^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT @@ -273,11 +273,12 @@ testVoidSyncStar(void x) sync* { const void c = null; -dynamic testVoidDefaultParameter( - [int y = c]) {} // void_default_parameter_global -// ^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. +dynamic testVoidDefaultParameter([ + int y = c, + // ^ + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. +]) {} // void_default_parameter_global dynamic testVoidDefaultParameterClosure() { ([int y = c]) => 3; // void_default_parameter_closure @@ -320,10 +321,10 @@ Object? testVoidCall(void f()) { // [cfe] This expression has type 'void' and can't be used. f() is Object?; // call_is -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. throw f(); // call_throw // ^^^ @@ -358,10 +359,10 @@ Object? testVoidCall(void f()) { // [cfe] This expression has type 'void' and can't be used. f() ?? 499; // call_null_equals1 -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. null ?? f(); // call_null_equals2: ok @@ -394,22 +395,22 @@ Object? testVoidCall(void f()) { // [cfe] This expression has type 'void' and can't be used. f().toString(); // call_toString -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. f()?.toString(); // call_null_dot -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. f()..toString(); // call_cascade -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. if (f()) {} // call_conditional_stmt // ^^^ @@ -418,16 +419,16 @@ Object? testVoidCall(void f()) { // [cfe] This expression has type 'void' and can't be used. !f(); // call_boolean_negation -// ^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. f() && true; // call_boolean_and_left -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. true && f(); // call_boolean_and_right // ^^^ @@ -436,10 +437,10 @@ Object? testVoidCall(void f()) { // [cfe] This expression has type 'void' and can't be used. f() || true; // call_boolean_or_left -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. true || f(); // call_boolean_or_right // ^^^ @@ -448,10 +449,10 @@ Object? testVoidCall(void f()) { // [cfe] This expression has type 'void' and can't be used. f() == 3; // call_equals_left -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. 3 == f(); // call_equals_right // ^^^ @@ -478,19 +479,19 @@ Object? testVoidCall(void f()) { // [cfe] This expression has type 'void' and can't be used. -f(); // call_negation -//^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] The operator 'unary-' isn't defined for the class 'void'. -// ^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] The operator 'unary-' isn't defined for the class 'void'. + // [error column 4, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. f()(3); // call_use_as_function -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. // ^ // [cfe] The method 'call' isn't defined for the class 'void'. @@ -561,16 +562,16 @@ Object? testVoidLocal() { // [cfe] This expression has type 'void' and can't be used. x is Object?; // local_is -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. throw x; // local_throw // ^ // [analyzer] COMPILE_TIME_ERROR.THROW_OF_INVALID_TYPE // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT - // [cfe] This expression has type 'void' and can't be used. // [cfe] Can't throw a value of 'void' since it is neither dynamic nor non-nullable. + // [cfe] This expression has type 'void' and can't be used. [x]; // local_literal_void_list_init: ok @@ -594,9 +595,9 @@ Object? testVoidLocal() { // [cfe] This expression has type 'void' and can't be used. x ?? 499; // local_null_equals1 -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. null ?? x; // local_null_equals2: ok @@ -627,26 +628,26 @@ Object? testVoidLocal() { for (x in [1, 2]) {} // local_for_in2: ok x += 1; // local_plus_eq -//^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3] + // [cfe] This expression has type 'void' and can't be used. //^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] The operator '+' isn't defined for the class 'void'. x.toString(); // local_toString -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x?.toString(); // local_null_dot -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x..toString(); // local_cascade -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. if (x) {} // local_conditional_stmt // ^ @@ -654,14 +655,14 @@ Object? testVoidLocal() { // [cfe] This expression has type 'void' and can't be used. !x; // local_boolean_negation -// ^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 4, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x && true; // local_boolean_and_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true && x; // local_boolean_and_right // ^ @@ -669,9 +670,9 @@ Object? testVoidLocal() { // [cfe] This expression has type 'void' and can't be used. x || true; // local_boolean_or_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true || x; // local_boolean_or_right // ^ @@ -679,9 +680,9 @@ Object? testVoidLocal() { // [cfe] This expression has type 'void' and can't be used. x == 3; // local_equals_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. 3 == x; // local_equals_right // ^ @@ -704,19 +705,19 @@ Object? testVoidLocal() { // [cfe] This expression has type 'void' and can't be used. -x; // local_negation -//^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] The operator 'unary-' isn't defined for the class 'void'. -// ^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] The operator 'unary-' isn't defined for the class 'void'. + // [error column 4, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x(3); // local_use_as_function -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. -// ^ -// [cfe] The method 'call' isn't defined for the class 'void'. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. + // [error column 4] + // [cfe] The method 'call' isn't defined for the class 'void'. "hello$x"; // local_use_in_string_interpolation // ^ @@ -724,10 +725,10 @@ Object? testVoidLocal() { // [cfe] This expression has type 'void' and can't be used. x ??= 3; // local_use_in_conditional_assignment_left + // [error column 3] + // [cfe] This expression has type 'void' and can't be used. //^^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -//^ -// [cfe] This expression has type 'void' and can't be used. Object? xx; xx ??= x; // local_use_in_conditional_assignment_right @@ -786,16 +787,16 @@ Object? testVoidFinalLocal() { // [cfe] This expression has type 'void' and can't be used. x is Object?; // final_local_is -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. throw x; // final_local_throw // ^ - // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [analyzer] COMPILE_TIME_ERROR.THROW_OF_INVALID_TYPE - // [cfe] This expression has type 'void' and can't be used. + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] Can't throw a value of 'void' since it is neither dynamic nor non-nullable. + // [cfe] This expression has type 'void' and can't be used. [x]; // final_local_literal_void_list_init: ok @@ -819,9 +820,9 @@ Object? testVoidFinalLocal() { // [cfe] This expression has type 'void' and can't be used. x ?? 499; // final_local_null_equals1 -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. null ?? x; // final_local_null_equals2: ok @@ -856,19 +857,19 @@ Object? testVoidFinalLocal() { // x += 1; // final_local_plus_eq x.toString(); // final_local_toString -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x?.toString(); // final_local_null_dot -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x..toString(); // final_local_cascade -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. if (x) {} // final_local_conditional_stmt // ^ @@ -876,14 +877,14 @@ Object? testVoidFinalLocal() { // [cfe] This expression has type 'void' and can't be used. !x; // final_local_boolean_negation -// ^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 4, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x && true; // final_local_boolean_and_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true && x; // final_local_boolean_and_right // ^ @@ -891,9 +892,9 @@ Object? testVoidFinalLocal() { // [cfe] This expression has type 'void' and can't be used. x || true; // final_local_boolean_or_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true || x; // final_local_boolean_or_right // ^ @@ -901,9 +902,9 @@ Object? testVoidFinalLocal() { // [cfe] This expression has type 'void' and can't be used. x == 3; // final_local_equals_left -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. 3 == x; // final_local_equals_right // ^ @@ -926,19 +927,19 @@ Object? testVoidFinalLocal() { // [cfe] This expression has type 'void' and can't be used. -x; // final_local_negation -//^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] The operator 'unary-' isn't defined for the class 'void'. -// ^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] The operator 'unary-' isn't defined for the class 'void'. + // [error column 4, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. x(3); // final_local_use_as_function -//^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. -// ^ -// [cfe] The method 'call' isn't defined for the class 'void'. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. + // [error column 4] + // [cfe] The method 'call' isn't defined for the class 'void'. "hello$x"; // final_local_use_in_string_interpolation // ^ @@ -946,10 +947,10 @@ Object? testVoidFinalLocal() { // [cfe] This expression has type 'void' and can't be used. x ??= 3; // final_local_use_in_conditional_assignment_left -//^ -// [cfe] This expression has type 'void' and can't be used. -// ^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3] + // [cfe] This expression has type 'void' and can't be used. + //^^^ + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT Object? xx; xx ??= x; // final_local_use_in_conditional_assignment_right @@ -1001,9 +1002,9 @@ Object? testVoidGlobal() { // [cfe] This expression has type 'void' and can't be used. global is Object?; // global_is -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. throw global; // global_throw // ^^^^^^ @@ -1034,9 +1035,9 @@ Object? testVoidGlobal() { // [cfe] This expression has type 'void' and can't be used. global ?? 499; // global_null_equals1 -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. null ?? global; // global_null_equals2: ok @@ -1067,26 +1068,26 @@ Object? testVoidGlobal() { for (global in [1, 2]) {} // global_for_in2: ok global += 1; // global_plus_eq -//^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3] + // [cfe] This expression has type 'void' and can't be used. // ^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] The operator '+' isn't defined for the class 'void'. global.toString(); // global_toString -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. global?.toString(); // global_null_dot -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. global..toString(); // global_cascade -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. if (global) {} // global_conditional_stmt // ^^^^^^ @@ -1094,14 +1095,14 @@ Object? testVoidGlobal() { // [cfe] This expression has type 'void' and can't be used. !global; // global_boolean_negation -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 4, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. global && true; // global_boolean_and_left -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true && global; // global_boolean_and_right // ^^^^^^ @@ -1109,9 +1110,9 @@ Object? testVoidGlobal() { // [cfe] This expression has type 'void' and can't be used. global || true; // global_boolean_or_left -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. true || global; // global_boolean_or_right // ^^^^^^ @@ -1119,9 +1120,9 @@ Object? testVoidGlobal() { // [cfe] This expression has type 'void' and can't be used. global == 3; // global_equals_left -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. 3 == global; // global_equals_right // ^^^^^^ @@ -1144,17 +1145,17 @@ Object? testVoidGlobal() { // [cfe] This expression has type 'void' and can't be used. -global; // global_negation -//^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] The operator 'unary-' isn't defined for the class 'void'. -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] The operator 'unary-' isn't defined for the class 'void'. + // [error column 4, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. global(3); // global_use_as_function -//^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 6] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [cfe] This expression has type 'void' and can't be used. // ^ // [cfe] The method 'call' isn't defined for the class 'void'. @@ -1164,10 +1165,10 @@ Object? testVoidGlobal() { // [cfe] This expression has type 'void' and can't be used. global ??= 3; // global_use_in_conditional_assignment_left + // [error column 3] + // [cfe] This expression has type 'void' and can't be used. // ^^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -//^ -// [cfe] This expression has type 'void' and can't be used. Object? xx; xx ??= global; // global_use_in_conditional_assignment_right @@ -1205,11 +1206,11 @@ Object? testVoidConditional() { true ? true - ? x - : x + ? x + : x : true - ? x - : x; // conditional_conditional: ok + ? x + : x; // conditional_conditional: ok for (true ? x : x; false; true ? x : x) {} // conditional_for: ok @@ -1230,10 +1231,10 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? x : x) is Object?; // conditional_is -//^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 14] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. throw true ? x : x; // conditional_throw // ^^^^^^^^^^^^ @@ -1261,8 +1262,8 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? x : x) ?? null; // conditional_null_equals1 -//^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 14] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // ^ // [cfe] This expression has type 'void' and can't be used. @@ -1294,22 +1295,22 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? x : x).toString(); // conditional_toString -//^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 14] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? x : x)?.toString(); // conditional_null_dot -//^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 14] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? x : x)..toString(); // conditional_cascade -//^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 14] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? 499 : x); // conditional2_parens: ok @@ -1317,11 +1318,11 @@ Object? testVoidConditional() { true ? true - ? 499 - : x + ? 499 + : x : true - ? 499 - : x; // conditional2_conditional: ok + ? 499 + : x; // conditional2_conditional: ok for (true ? 499 : x; false; true ? 499 : x) {} // conditional2_for: ok @@ -1342,10 +1343,10 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? 499 : x) is Object?; // conditional2_is -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. throw true ? 499 : x; // conditional2_throw // ^^^^^^^^^^^^^^ @@ -1364,7 +1365,7 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. var m12 = { - 4: true ? 499 : x + 4: true ? 499 : x, }; // conditional2_literal_map_value_init: ok // conditional2_literal_map_value_init2 @@ -1375,8 +1376,8 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? 499 : x) ?? null; // conditional2_null_equals1 -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // ^ // [cfe] This expression has type 'void' and can't be used. @@ -1408,22 +1409,22 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? 499 : x).toString(); // conditional2_toString -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? 499 : x)?.toString(); // conditional2_null_dot -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? 499 : x)..toString(); // conditional2_cascade -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? x : 499); // conditional3_parens: ok @@ -1431,11 +1432,11 @@ Object? testVoidConditional() { true ? true - ? x - : 499 + ? x + : 499 : true - ? x - : 499; // conditional3_conditional: ok + ? x + : 499; // conditional3_conditional: ok for (true ? x : 499; false; true ? x : 499) {} // conditional3_for: ok @@ -1456,10 +1457,10 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? x : 499) is Object?; // conditional3_is -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. throw true ? x : 499; // conditional3_throw // ^^^^^^^^^^^^^^ @@ -1478,7 +1479,7 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. var m13 = { - 4: true ? x : 499 + 4: true ? x : 499, }; // conditional3_literal_map_value_init: ok // conditional3_literal_map_value_init2 @@ -1489,8 +1490,8 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? x : 499) ?? null; // conditional3_null_equals1 -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // ^ // [cfe] This expression has type 'void' and can't be used. @@ -1522,22 +1523,22 @@ Object? testVoidConditional() { // [cfe] This expression has type 'void' and can't be used. (true ? x : 499).toString(); // conditional3_toString -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? x : 499)?.toString(); // conditional3_null_dot -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. (true ? x : 499)..toString(); // conditional3_cascade -//^^^^^^^^^^^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 16] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // ^ + // [cfe] This expression has type 'void' and can't be used. } dynamic testVoidConditionalDynamic() { @@ -1611,8 +1612,8 @@ Object? testInstanceField() { // [cfe] This expression has type 'void' and can't be used. a.x is Object?; // instance_is -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1650,8 +1651,8 @@ Object? testInstanceField() { // [cfe] This expression has type 'void' and can't be used. a.x ?? 499; // instance_null_equals1 -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1683,27 +1684,25 @@ Object? testInstanceField() { // [cfe] This expression has type 'void' and can't be used. a.x += 1; // instance_plus_eq - //^ - // [cfe] This expression has type 'void' and can't be used. // ^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] The operator '+' isn't defined for the class 'void'. a.x.toString(); // instance_toString -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. a.x?.toString(); // instance_null_dot -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. a.x..toString(); // instance_cascade -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1736,8 +1735,8 @@ Object? testInstanceField() { // [cfe] This expression has type 'void' and can't be used. b.x is Object?; // instance2_is -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1774,8 +1773,8 @@ Object? testInstanceField() { // [cfe] This expression has type 'void' and can't be used. b.x ?? 499; // instance2_null_equals1 -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1809,27 +1808,25 @@ Object? testInstanceField() { b.forInTest(); b.x += 1; // instance2_plus_eq - //^ - // [cfe] This expression has type 'void' and can't be used. // ^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] The operator '+' isn't defined for the class 'void'. b.x.toString(); // instance2_toString -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. b.x?.toString(); // instance2_null_dot -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. b.x..toString(); // instance2_cascade -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1862,8 +1859,8 @@ Object? testInstanceField() { // [cfe] This expression has type 'void' and can't be used. c.x is Object?; // instance3_is -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1900,8 +1897,8 @@ Object? testInstanceField() { // [cfe] This expression has type 'void' and can't be used. c.x ?? 499; // instance3_null_equals1 -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. @@ -1935,27 +1932,25 @@ Object? testInstanceField() { c.forInTest(); c.x += 1; // instance3_plus_eq - //^ - // [cfe] This expression has type 'void' and can't be used. // ^^ // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // [cfe] The operator '+' isn't defined for the class 'void'. c.x.toString(); // instance3_toString -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. c.x?.toString(); // instance3_null_dot -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. c.x..toString(); // instance3_cascade -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. } @@ -2003,18 +1998,18 @@ Object? testParenthesized() { // [cfe] This expression has type 'void' and can't be used. (x) is Object?; // paren_is -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. throw (x); // paren_throw // ^^^ // [analyzer] COMPILE_TIME_ERROR.THROW_OF_INVALID_TYPE // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT // ^ - // [cfe] This expression has type 'void' and can't be used. // [cfe] Can't throw a value of 'void' since it is neither dynamic nor non-nullable. + // [cfe] This expression has type 'void' and can't be used. [(x)]; // paren_literal_void_list_init: ok @@ -2041,10 +2036,10 @@ Object? testParenthesized() { // [cfe] This expression has type 'void' and can't be used. (x) ?? 499; // paren_null_equals1 -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. null ?? (x); // paren_null_equals2: ok @@ -2077,22 +2072,22 @@ Object? testParenthesized() { // [cfe] This expression has type 'void' and can't be used. (x).toString(); // paren_toString -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. (x)?.toString(); // paren_null_dot -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. (x)..toString(); // paren_cascade -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. if ((x)) {} // paren_conditional_stmt // ^^^ @@ -2101,16 +2096,16 @@ Object? testParenthesized() { // [cfe] This expression has type 'void' and can't be used. !(x); // paren_boolean_negation -// ^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT //^ // [cfe] This expression has type 'void' and can't be used. (x) && true; // paren_boolean_and_left -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. true && (x); // paren_boolean_and_right // ^^^ @@ -2119,10 +2114,10 @@ Object? testParenthesized() { // [cfe] This expression has type 'void' and can't be used. (x) || true; // paren_boolean_or_left -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. true || (x); // paren_boolean_or_right // ^^^ @@ -2131,10 +2126,10 @@ Object? testParenthesized() { // [cfe] This expression has type 'void' and can't be used. (x) == 3; // paren_equals_left -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. 3 == (x); // paren_equals_right // ^^^ @@ -2161,19 +2156,19 @@ Object? testParenthesized() { // [cfe] This expression has type 'void' and can't be used. -(x); // paren_negation -//^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] The operator 'unary-' isn't defined for the class 'void'. -// ^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] The operator 'unary-' isn't defined for the class 'void'. + // [error column 4, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + //^ + // [cfe] This expression has type 'void' and can't be used. (x)(3); // paren_use_as_function -//^^^ -// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT -// ^ -// [cfe] This expression has type 'void' and can't be used. + // [error column 3, length 3] + // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT + // [error column 4] + // [cfe] This expression has type 'void' and can't be used. // ^ // [cfe] The method 'call' isn't defined for the class 'void'. diff --git a/tests/language/why_not_promoted/argument_type_not_assignable_nullability_error_test.dart b/tests/language/why_not_promoted/argument_type_not_assignable_nullability_error_test.dart index a4c711630d8..1119f19a0ad 100644 --- a/tests/language/why_not_promoted/argument_type_not_assignable_nullability_error_test.dart +++ b/tests/language/why_not_promoted/argument_type_not_assignable_nullability_error_test.dart @@ -246,13 +246,11 @@ class C14 { // ^^^ // [context 14] 'bad' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field // [context 63] 'bad' refers to a public property so it couldn't be promoted. - C14.assertInitializerCondition(C14 c) - : bad = c.bad!, - assert(c.bad); - // ^^^^^ - // [analyzer 14] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE - // ^ - // [cfe 63] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't. + C14.assertInitializerCondition(C14 c) : bad = c.bad!, assert(c.bad); + // ^^^^^ + // [analyzer 14] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // ^ + // [cfe 63] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't. } class C15 { @@ -434,13 +432,11 @@ class C23 { // [context 78] 'bad' refers to a public property so it couldn't be promoted. final int x; final int y; - C23.constructorInitializer(C23 c) - : x = c.bad!, - y = c.bad; - // ^^^^^ - // [analyzer 29] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE - // ^ - // [cfe 78] A value of type 'int?' can't be assigned to a variable of type 'int' because 'int?' is nullable and 'int' isn't. + C23.constructorInitializer(C23 c) : x = c.bad!, y = c.bad; + // ^^^^^ + // [analyzer 29] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE + // ^ + // [cfe 78] A value of type 'int?' can't be assigned to a variable of type 'int' because 'int?' is nullable and 'int' isn't. } class C24 { @@ -674,13 +670,11 @@ class C34 { class D34 extends C34 { int other; - D34(C34 c) - : other = c.bad!, - super(c.bad); - // ^^^^^ - // [analyzer 48] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE - // ^ - // [cfe 97] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't. + D34(C34 c) : other = c.bad!, super(c.bad); + // ^^^^^ + // [analyzer 48] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE + // ^ + // [cfe 97] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't. } class C35 { diff --git a/tests/language/why_not_promoted/assignment_error_test.dart b/tests/language/why_not_promoted/assignment_error_test.dart index 9c1c3a4decf..8dfe0a13847 100644 --- a/tests/language/why_not_promoted/assignment_error_test.dart +++ b/tests/language/why_not_promoted/assignment_error_test.dart @@ -10,62 +10,62 @@ abstract class C { direct_assignment(int? i, int? j) { if (i == null) return; i = j; -//^^^^^ -// [context 6] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write -// [context 10] Variable 'i' could not be promoted due to an assignment. + // [error column 3, length 5] + // [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 10] Variable 'i' could not be promoted due to an assignment. i.isEven; -// ^^^^^^ -// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } compound_assignment(C? c, int i) { if (c == null) return; c += i; -//^^^^^^ -// [context 7] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write -// [context 11] Variable 'c' could not be promoted due to an assignment. + // [error column 3, length 6] + // [context 2] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 11] Variable 'c' could not be promoted due to an assignment. c.cProperty; -// ^^^^^^^^^ -// [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 11] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null. + //^^^^^^^^^ + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 11] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null. } via_postfix_op(C? c) { if (c == null) return; c++; -//^^^ -// [context 4] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write -// [context 12] Variable 'c' could not be promoted due to an assignment. + // [error column 3, length 3] + // [context 3] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 12] Variable 'c' could not be promoted due to an assignment. c.cProperty; -// ^^^^^^^^^ -// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 12] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null. + //^^^^^^^^^ + // [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 12] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null. } via_prefix_op(C? c) { if (c == null) return; ++c; -//^^^ -// [context 9] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [error column 3, length 3] + // [context 4] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write //^ // [context 13] Variable 'c' could not be promoted due to an assignment. c.cProperty; -// ^^^^^^^^^ -// [analyzer 9] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 13] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null. + //^^^^^^^^^ + // [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 13] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null. } via_for_each_statement(int? i, List list) { if (i == null) return; for (i in list) { // ^ - // [context 3] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 5] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write // [context 14] Variable 'i' could not be promoted due to an assignment. i.isEven; -// ^^^^^^ -// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 14] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 14] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } } @@ -73,10 +73,10 @@ via_for_each_list_element(int? i, List list) { if (i == null) return; [for (i in list) i.isEven]; // ^ - // [context 8] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 6] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write // [context 15] Variable 'i' could not be promoted due to an assignment. // ^^^^^^ - // [analyzer 8] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE // [cfe 15] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } @@ -84,10 +84,10 @@ via_for_each_set_element(int? i, List list) { if (i == null) return; ({for (i in list) i.isEven}); // ^ - // [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 7] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write // [context 16] Variable 'i' could not be promoted due to an assignment. // ^^^^^^ - // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE // [cfe 16] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } @@ -95,10 +95,10 @@ via_for_each_map_key(int? i, List list) { if (i == null) return; ({for (i in list) i.isEven: null}); // ^ - // [context 2] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 8] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write // [context 17] Variable 'i' could not be promoted due to an assignment. // ^^^^^^ - // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [analyzer 8] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE // [cfe 17] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } @@ -106,9 +106,9 @@ via_for_each_map_value(int? i, List list) { if (i == null) return; ({for (i in list) null: i.isEven}); // ^ - // [context 5] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 9] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write // [context 18] Variable 'i' could not be promoted due to an assignment. // ^^^^^^ - // [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [analyzer 9] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE // [cfe 18] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } diff --git a/tests/language/why_not_promoted/extension_property_error_test.dart b/tests/language/why_not_promoted/extension_property_error_test.dart index 26e84bf85c7..a1c545b0f54 100644 --- a/tests/language/why_not_promoted/extension_property_error_test.dart +++ b/tests/language/why_not_promoted/extension_property_error_test.dart @@ -6,25 +6,25 @@ class C { get_property_via_explicit_this() { if (this.i == null) return; this.i.isEven; -// ^^^^^^ -// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 6] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 6] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_via_explicit_this_parenthesized() { if ((this).i == null) return; (this).i.isEven; -// ^^^^^^ -// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_by_implicit_this() { if (i == null) return; i.isEven; -// ^^^^^^ -// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } } @@ -48,18 +48,18 @@ class D extends C { get_property_by_implicit_super() { if (i == null) return; i.isEven; -// ^^^^^^ -// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } } get_property_via_prefixed_identifier(C c) { if (c.i == null) return; c.i.isEven; -// ^^^^^^ -// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) { @@ -67,9 +67,9 @@ get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) { // to promote is on c1, but the property the user is accessing is on c2. if (c1.i == null) return; c2.i.isEven; -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_via_prefixed_identifier_mismatched_property(C c) { @@ -77,7 +77,7 @@ get_property_via_prefixed_identifier_mismatched_property(C c) { // to promote is C.i, but the property the user is accessing is C.j. if (c.i == null) return; c.j.isEven; -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [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/why_not_promoted/field_error_test.dart b/tests/language/why_not_promoted/field_error_test.dart index dc4fb1c963e..bff3464b88a 100644 --- a/tests/language/why_not_promoted/field_error_test.dart +++ b/tests/language/why_not_promoted/field_error_test.dart @@ -22,25 +22,25 @@ class C { get_field_via_explicit_this() { if (this.i == null) return; this.i.isEven; -// ^^^^^^ -// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_field_via_explicit_this_parenthesized() { if ((this).i == null) return; (this).i.isEven; -// ^^^^^^ -// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_field_by_implicit_this() { if (i == null) return; i.isEven; -// ^^^^^^ -// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } } @@ -48,26 +48,26 @@ class D extends C { get_field_via_explicit_super() { if (super.i == null) return; super.i.isEven; -// ^^^^^^ -// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_field_by_implicit_super() { if (i == null) return; i.isEven; -// ^^^^^^ -// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } } get_field_via_prefixed_identifier(C c) { if (c.i == null) return; c.i.isEven; -// ^^^^^^ -// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_field_via_prefixed_identifier_mismatched_target(C c1, C c2) { @@ -75,9 +75,9 @@ get_field_via_prefixed_identifier_mismatched_target(C c1, C c2) { // to promote is on c1, but the property the user is accessing is on c2. if (c1.i == null) return; c2.i.isEven; -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_field_via_prefixed_identifier_mismatched_property(C c) { @@ -85,7 +85,7 @@ get_field_via_prefixed_identifier_mismatched_property(C c) { // to promote is C.i, but the property the user is accessing is C.j. if (c.i == null) return; c.j.isEven; -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [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/why_not_promoted/nullable_expression_call_error_test.dart b/tests/language/why_not_promoted/nullable_expression_call_error_test.dart index eec92a4eb21..012ecffdf9e 100644 --- a/tests/language/why_not_promoted/nullable_expression_call_error_test.dart +++ b/tests/language/why_not_promoted/nullable_expression_call_error_test.dart @@ -20,10 +20,10 @@ class C2 { instance_method_invocation(C1 c) { if (c.bad == null) return; c.bad(); -//^^^^^ -// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// ^ -// [cfe 7] Can't use an expression of type 'C2?' as a function because it's potentially null. + // [error column 3, length 5] + // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // ^ + // [cfe 7] Can't use an expression of type 'C2?' as a function because it's potentially null. } class C3 { @@ -51,10 +51,10 @@ extension_invocation_method(C3 c) { c.ok(); if (c.bad == null) return; c.bad(); -//^^^^^ -// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// ^ -// [cfe 8] Can't use an expression of type 'C5?' as a function because it's potentially null. + // [error column 3, length 5] + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // ^ + // [cfe 8] Can't use an expression of type 'C5?' as a function because it's potentially null. } class C6 { @@ -71,11 +71,11 @@ class C7 { instance_getter_invocation(C6 c) { if (c.bad == null) return; c.bad(); -//^^^^^ -// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION -// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// ^ -// [cfe 9] Can't use an expression of type 'C7?' as a function because it's potentially null. + // [error column 3, length 5] + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION + // [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // ^ + // [cfe 9] Can't use an expression of type 'C7?' as a function because it's potentially null. } class C8 { @@ -94,10 +94,10 @@ extension on C10 { extension_invocation_getter(C8 c) { if (c.bad == null) return; c.bad(); -//^^^^^ -// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// ^ -// [cfe 10] Can't use an expression of type 'C10?' as a function because it's potentially null. + // [error column 3, length 5] + // [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // ^ + // [cfe 10] Can't use an expression of type 'C10?' as a function because it's potentially null. } class C11 { @@ -110,10 +110,10 @@ class C11 { function_invocation(C11 c) { if (c.bad == null) return; c.bad(); -//^^^^^ -// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// ^ -// [cfe 11] Can't use an expression of type 'void Function()?' as a function because it's potentially null. + // [error column 3, length 5] + // [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // ^ + // [cfe 11] Can't use an expression of type 'void Function()?' as a function because it's potentially null. } class C12 { @@ -133,7 +133,7 @@ instance_field_invocation(C12 c) { // Note: the CFE error message is misleading here. See // https://github.com/dart-lang/sdk/issues/45552 c.bad.foo(); -// ^^^ -// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 12] Can't use an expression of type 'C13?' as a function because it's potentially null. + // ^^^ + // [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 12] Can't use an expression of type 'C13?' as a function because it's potentially null. } diff --git a/tests/language/why_not_promoted/nullable_method_call_error_test.dart b/tests/language/why_not_promoted/nullable_method_call_error_test.dart index 0c22880598a..4ebb54e9cd8 100644 --- a/tests/language/why_not_promoted/nullable_method_call_error_test.dart +++ b/tests/language/why_not_promoted/nullable_method_call_error_test.dart @@ -36,66 +36,66 @@ extension on int? { property_get_of_variable(int? i, int? j) { if (i == null) return; i = j; -//^^^^^ -// [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write -// [context 8] Variable 'i' could not be promoted due to an assignment. + // [error column 3, length 5] + // [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 8] Variable 'i' could not be promoted due to an assignment. i.isEven; -// ^^^^^^ -// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } extension_property_get_of_variable(int? i, int? j) { if (i == null) return; i = j; -//^^^^^ -// [context 2] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write -// [context 9] Variable 'i' could not be promoted due to an assignment. + // [error column 3, length 5] + // [context 2] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write + // [context 9] Variable 'i' could not be promoted due to an assignment. i.propertyOnNullableInt; i.propertyOnNonNullInt; -// ^^^^^^^^^^^^^^^^^^^^ -// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 9] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^^^^^^^^^^^^^^^ + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 9] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null. } property_get_of_expression(C c) { if (c.i == null) return; c.i.isEven; -// ^^^^^^ -// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } extension_property_get_of_expression(C c) { if (c.i == null) return; c.i.propertyOnNullableInt; c.i.propertyOnNonNullInt; -// ^^^^^^^^^^^^^^^^^^^^ -// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 11] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^^^^^^^^^^^^^^^ + // [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 11] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null. } method_invocation(C c) { if (c.i == null) return; c.i.abs(); -// ^^^ -// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 12] Method 'abs' cannot be called on 'int?' because it is potentially null. + // ^^^ + // [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 12] Method 'abs' cannot be called on 'int?' because it is potentially null. } extension_method_invocation(C c) { if (c.i == null) return; c.i.methodOnNullableInt(); c.i.methodOnNonNullInt(); -// ^^^^^^^^^^^^^^^^^^ -// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 13] Method 'methodOnNonNullInt' cannot be called on 'int?' because it is potentially null. + // ^^^^^^^^^^^^^^^^^^ + // [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 13] Method 'methodOnNonNullInt' cannot be called on 'int?' because it is potentially null. } call_invocation(C c) { if (c.f == null) return; c.f.call(); -// ^^^^ -// [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 14] Method 'call' cannot be called on 'void Function()?' because it is potentially null. + // ^^^^ + // [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 14] Method 'call' cannot be called on 'void Function()?' because it is potentially null. } diff --git a/tests/language/why_not_promoted/nullable_operator_call_error_test.dart b/tests/language/why_not_promoted/nullable_operator_call_error_test.dart index 808f858df45..391e1adc2e3 100644 --- a/tests/language/why_not_promoted/nullable_operator_call_error_test.dart +++ b/tests/language/why_not_promoted/nullable_operator_call_error_test.dart @@ -31,7 +31,7 @@ class C2 { userDefinableUnaryOp(C2 c) { if (c.bad == null) return; -c.bad; -//^ -// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 4] Operator 'unary-' cannot be called on 'int?' because it is potentially null. + // [error column 3, length 1] + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 4] Operator 'unary-' cannot be called on 'int?' because it is potentially null. } diff --git a/tests/language/why_not_promoted/property_error_test.dart b/tests/language/why_not_promoted/property_error_test.dart index 1bf987c771e..7b852cd31a4 100644 --- a/tests/language/why_not_promoted/property_error_test.dart +++ b/tests/language/why_not_promoted/property_error_test.dart @@ -22,25 +22,25 @@ class C { get_property_via_explicit_this() { if (this.i == null) return; this.i.isEven; -// ^^^^^^ -// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_via_explicit_this_parenthesized() { if ((this).i == null) return; (this).i.isEven; -// ^^^^^^ -// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_by_implicit_this() { if (i == null) return; i.isEven; -// ^^^^^^ -// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } } @@ -48,26 +48,26 @@ class D extends C { get_property_via_explicit_super() { if (super.i == null) return; super.i.isEven; -// ^^^^^^ -// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_by_implicit_super() { if (i == null) return; i.isEven; -// ^^^^^^ -// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + //^^^^^^ + // [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } } get_property_via_prefixed_identifier(C c) { if (c.i == null) return; c.i.isEven; -// ^^^^^^ -// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) { @@ -75,9 +75,9 @@ get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) { // to promote is on c1, but the property the user is accessing is on c2. if (c1.i == null) return; c2.i.isEven; -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. } get_property_via_prefixed_identifier_mismatched_property(C c) { @@ -85,7 +85,7 @@ get_property_via_prefixed_identifier_mismatched_property(C c) { // to promote is C.i, but the property the user is accessing is C.j. if (c.i == null) return; c.j.isEven; -// ^^^^^^ -// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // ^^^^^^ + // [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/why_not_promoted/this_error_test.dart b/tests/language/why_not_promoted/this_error_test.dart index 87d98c98e1f..c4f1587b97a 100644 --- a/tests/language/why_not_promoted/this_error_test.dart +++ b/tests/language/why_not_promoted/this_error_test.dart @@ -13,20 +13,20 @@ extension on int? { extension_explicit_this() { if (this == null) return; this.isEven; -// ^^^^^^ -// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [context 1] 'this' can't be promoted. See http://dart.dev/go/non-promo-this -// [cfe 3] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. -// [context 3] 'this' can't be promoted. + // ^^^^^^ + // [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [context 1] 'this' can't be promoted. See http://dart.dev/go/non-promo-this + // [cfe 3] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // [context 3] 'this' can't be promoted. } extension_implicit_this() { if (this == null) return; isEven; -// ^^^^^^ -// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE -// [context 2] 'this' can't be promoted. See http://dart.dev/go/non-promo-this -// [cfe 4] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. -// [context 4] 'this' can't be promoted. + // [error column 5, length 6] + // [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE + // [context 2] 'this' can't be promoted. See http://dart.dev/go/non-promo-this + // [cfe 4] Property 'isEven' cannot be accessed on 'int?' because it is potentially null. + // [context 4] 'this' can't be promoted. } } diff --git a/tests/language/wildcard_variables/declarations/local_function_error_test.dart b/tests/language/wildcard_variables/declarations/local_function_error_test.dart index 04035ed62a2..dc65880e5e2 100644 --- a/tests/language/wildcard_variables/declarations/local_function_error_test.dart +++ b/tests/language/wildcard_variables/declarations/local_function_error_test.dart @@ -7,8 +7,8 @@ void main() { void _() {} - /*indent*/ _(); - // ^ + _(); + // [error column 3, length 1] // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Method not found: '_'. } diff --git a/tests/language/wildcard_variables/feature_enabled_error_test.dart b/tests/language/wildcard_variables/feature_enabled_error_test.dart index f7962603d71..fb2a5d1ac14 100644 --- a/tests/language/wildcard_variables/feature_enabled_error_test.dart +++ b/tests/language/wildcard_variables/feature_enabled_error_test.dart @@ -7,7 +7,7 @@ main() { int _ = 1; _ = 2; -//^ -// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER -// [cfe] Setter not found: '_'. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER + // [cfe] Setter not found: '_'. } diff --git a/tests/language/wildcard_variables/import/import_error_test.dart b/tests/language/wildcard_variables/import/import_error_test.dart index 108d9ec13f1..fcaff747254 100644 --- a/tests/language/wildcard_variables/import/import_error_test.dart +++ b/tests/language/wildcard_variables/import/import_error_test.dart @@ -11,23 +11,23 @@ main() { var value = 'str'; _.topLevel; -//^ -// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER -// [cfe] Undefined name '_'. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER + // [cfe] Undefined name '_'. _.C(value); -//^ -// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER -// [cfe] Undefined name '_'. + // [error column 3, length 1] + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER + // [cfe] Undefined name '_'. // Private extensions can't be used. value.bar; -// ^^^ -// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER -// [cfe] The getter 'bar' isn't defined for the class 'String'. + // ^^^ + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER + // [cfe] The getter 'bar' isn't defined for the class 'String'. value.fn; -// ^^ -// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER -// [cfe] The getter 'fn' isn't defined for the class 'String'. + // ^^ + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER + // [cfe] The getter 'fn' isn't defined for the class 'String'. } diff --git a/tests/language/wildcard_variables/import/import_lib.dart b/tests/language/wildcard_variables/import/import_lib.dart index 8261192d549..ebd2c6f075b 100644 --- a/tests/language/wildcard_variables/import/import_lib.dart +++ b/tests/language/wildcard_variables/import/import_lib.dart @@ -8,9 +8,7 @@ class C { final bool bar; final bool fn; - C(String str) - : bar = str.bar, - fn = str.fn; + C(String str) : bar = str.bar, fn = str.fn; } extension StringExtension on String { diff --git a/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_access_error_test.dart b/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_access_error_test.dart index 87dade9f66f..4e6b6b7c1ef 100644 --- a/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_access_error_test.dart +++ b/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_access_error_test.dart @@ -9,9 +9,9 @@ class C { var other; C(this._) : other = _; -// ^ -// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER -// [cfe] Can't access 'this' in a field initializer to read '_'. + // ^ + // [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER + // [cfe] Can't access 'this' in a field initializer to read '_'. } class CWithTypeParameter<_> { @@ -19,7 +19,7 @@ class CWithTypeParameter<_> { var other; CWithTypeParameter(this._) : other = _; -// ^ -// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER -// [cfe] Can't access 'this' in a field initializer to read '_'. + // ^ + // [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER + // [cfe] Can't access 'this' in a field initializer to read '_'. } diff --git a/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_multiple_error_test.dart b/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_multiple_error_test.dart index 0f06295ee8b..bc540bd456f 100644 --- a/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_multiple_error_test.dart +++ b/tests/language/wildcard_variables/initializing_formal_parameters/this_initializer_multiple_error_test.dart @@ -8,12 +8,12 @@ class C { var _; C(this._, this._); -// ^ -// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER -// [cfe] '_' was already initialized by this constructor. + // ^ + // [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER + // [cfe] '_' was already initialized by this constructor. C.named(this._, this._); -// ^ -// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER -// [cfe] '_' was already initialized by this constructor. + // ^ + // [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER + // [cfe] '_' was already initialized by this constructor. } diff --git a/tests/language/wildcard_variables/multiple/local_declaration_for_loop_test.dart b/tests/language/wildcard_variables/multiple/local_declaration_for_loop_test.dart index 7b25fd09ac4..09832c7c2fd 100644 --- a/tests/language/wildcard_variables/multiple/local_declaration_for_loop_test.dart +++ b/tests/language/wildcard_variables/multiple/local_declaration_for_loop_test.dart @@ -8,7 +8,7 @@ import 'package:expect/async_helper.dart'; void main() async { // Multiple for-loop wildcard declarations. - for (int _ = 0, _ = 2;;) { + for (int _ = 0, _ = 2; ;) { break; } diff --git a/tests/language/wildcard_variables/multiple/local_declaration_function_parameter_test.dart b/tests/language/wildcard_variables/multiple/local_declaration_function_parameter_test.dart index 8de9c4155fb..5b1142599c7 100644 --- a/tests/language/wildcard_variables/multiple/local_declaration_function_parameter_test.dart +++ b/tests/language/wildcard_variables/multiple/local_declaration_function_parameter_test.dart @@ -59,22 +59,23 @@ class StaticMethod { static int staticMethod2(_, _) => 2; static int staticMethod_functionType(void _(), void _()) => 2; static int staticMethod_functionTypeNested( - void _(_, _), void _(int _, int _)) => - 2; + void _(_, _), + void _(int _, int _), + ) => 2; static int staticMethod_functionTypeNew( - void Function(int _, int _) _, void Function(int _, int _) _) => - 2; + void Function(int _, int _) _, + void Function(int _, int _) _, + ) => 2; static int staticMethod_functionTypeGeneric( - void Function<_, _>(int _, int _) _, void _<_>(_, _)) => - 2; + void Function<_, _>(int _, int _) _, + void _<_>(_, _), + ) => 2; } void main() { // Function expression var list = [true]; - list.where( - (_, [_]) => true, - ); + list.where((_, [_]) => true); // Abstract methods var abstractMethod = AbstractMethodSubclass();