diff --git a/tests/language/abstract/getter2_test.dart b/tests/language/abstract/getter2_test.dart index f2545ddaded..a12a105ac47 100644 --- a/tests/language/abstract/getter2_test.dart +++ b/tests/language/abstract/getter2_test.dart @@ -52,17 +52,15 @@ void main() { /// Tests that overriding either the getter or setter with an abstract member /// has no effect. /// Regression test for https://github.com/dart-lang/sdk/issues/29914 - var c1 = - AbstractGetterOverride1() - ..foo = 123 - ..bar = 456; + var c1 = AbstractGetterOverride1() + ..foo = 123 + ..bar = 456; Expect.equals(c1.foo, 123); Expect.equals(c1.bar, 456); - var c2 = - AbstractGetterOverride2() - ..foo = 123 - ..bar = 456; + var c2 = AbstractGetterOverride2() + ..foo = 123 + ..bar = 456; Expect.equals(c2.foo, 123); Expect.equals(c2.bar, 456); } diff --git a/tests/language/assert/initializer_test.dart b/tests/language/assert/initializer_test.dart index d62f7bd3d0a..a8801af196d 100644 --- a/tests/language/assert/initializer_test.dart +++ b/tests/language/assert/initializer_test.dart @@ -96,14 +96,13 @@ void test(int x, int y) { bool assertionsEnabled = false; assert(assertionsEnabled = true); - void Function(C Function()) doTest = - (assertionsEnabled && x >= y) - ? (f) { - Expect.throwsAssertionError(f); - } - : (f) { - Expect.equals(x, f().x); - }; + void Function(C Function()) doTest = (assertionsEnabled && x >= y) + ? (f) { + Expect.throwsAssertionError(f); + } + : (f) { + Expect.equals(x, f().x); + }; doTest(() => new C.c01(x, y)); doTest(() => new C.c02(x, y)); diff --git a/tests/language/async/congruence_unnamed_test.dart b/tests/language/async/congruence_unnamed_test.dart index 0aef8ad0858..97162166521 100644 --- a/tests/language/async/congruence_unnamed_test.dart +++ b/tests/language/async/congruence_unnamed_test.dart @@ -106,11 +106,11 @@ main() { } }; - Future Function() f_expressionSyntax_B = - () async => false ? new A() : new B(); + Future Function() f_expressionSyntax_B = () async => + false ? new A() : new B(); - Future Function() f_expressionSyntax_FutureB = - () async => false ? futureA() : futureB(); + Future Function() f_expressionSyntax_FutureB = () async => + false ? futureA() : futureB(); // Not executed void checkStaticTypes() { diff --git a/tests/language/await/await_with_no_context_test.dart b/tests/language/await/await_with_no_context_test.dart index 8ac64d42cb5..caa2b0074bc 100644 --- a/tests/language/await/await_with_no_context_test.dart +++ b/tests/language/await/await_with_no_context_test.dart @@ -56,8 +56,9 @@ main() async { // Target of a property set (await ((null as Future?) ?? - (Future.value(C())..expectStaticType>>()))) - .prop = 0; + (Future.value(C())..expectStaticType>>()))) + .prop = + 0; // Target of a property get (await ((null as Future?) ?? diff --git a/tests/language/call/implicit_tearoff_exceptions_test.dart b/tests/language/call/implicit_tearoff_exceptions_test.dart index e9edd8d5115..8443debd41a 100644 --- a/tests/language/call/implicit_tearoff_exceptions_test.dart +++ b/tests/language/call/implicit_tearoff_exceptions_test.dart @@ -113,7 +113,7 @@ void testIfNull() { bFalse ? d : ((c ?? a) // ignore: dead_null_aware_expression - ..expectStaticType>()), + ..expectStaticType>()), ), ); @@ -132,7 +132,7 @@ void testIfNull() { bFalse ? d : (((c) ?? a) // ignore: dead_null_aware_expression - ..expectStaticType>()), + ..expectStaticType>()), ), ); Expect.throws( @@ -145,7 +145,7 @@ void testIfNull() { bFalse ? d : ((((c)) ?? a) // ignore: dead_null_aware_expression - ..expectStaticType>()), + ..expectStaticType>()), ), ); Expect.throws( diff --git a/tests/language/cascade/in_expression_function_test.dart b/tests/language/cascade/in_expression_function_test.dart index add9c5aef32..88f95297858 100644 --- a/tests/language/cascade/in_expression_function_test.dart +++ b/tests/language/cascade/in_expression_function_test.dart @@ -5,16 +5,14 @@ import "package:expect/expect.dart"; -makeMap() => - new Map() - ..[3] = 4 - ..[0] = 11; +makeMap() => new Map() + ..[3] = 4 + ..[0] = 11; class MyClass { - foo() => - this - ..bar(3) - ..baz(4); + foo() => this + ..bar(3) + ..baz(4); bar(x) => x; baz(y) => y * 2; } diff --git a/tests/language/cascade/in_initializer_list_test.dart b/tests/language/cascade/in_initializer_list_test.dart index 0a45688fff3..e0a43032724 100644 --- a/tests/language/cascade/in_initializer_list_test.dart +++ b/tests/language/cascade/in_initializer_list_test.dart @@ -14,14 +14,12 @@ class B { final y; B(a) - : x = - a - ..foo() - ..bar(), - y = - a - ..foo() - ..bar() {} + : x = a + ..foo() + ..bar(), + y = a + ..foo() + ..bar() {} } main() { diff --git a/tests/language/cascade/nested_test.dart b/tests/language/cascade/nested_test.dart index 7e4033194f3..e0d864938d7 100644 --- a/tests/language/cascade/nested_test.dart +++ b/tests/language/cascade/nested_test.dart @@ -14,10 +14,9 @@ class Bar { } main() { - var bar = - new Bar() - ..foo = (new Foo()..x = 42) - ..y = 38; + var bar = new Bar() + ..foo = (new Foo()..x = 42) + ..y = 38; Expect.isTrue(bar is Bar); Expect.isTrue(bar.foo is Foo); Expect.equals(bar.foo.x, 42); diff --git a/tests/language/cascade/on_static_field_test.dart b/tests/language/cascade/on_static_field_test.dart index 4f394ccef87..6602307e59a 100644 --- a/tests/language/cascade/on_static_field_test.dart +++ b/tests/language/cascade/on_static_field_test.dart @@ -2,11 +2,10 @@ // 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. -final List list = - [] - ..add("foo") - ..add("bar") - ..add("baz"); +final List list = [] + ..add("foo") + ..add("bar") + ..add("baz"); main() { print(list); diff --git a/tests/language/cascade/precedence_test.dart b/tests/language/cascade/precedence_test.dart index 3e42255a664..5982141266d 100644 --- a/tests/language/cascade/precedence_test.dart +++ b/tests/language/cascade/precedence_test.dart @@ -171,19 +171,17 @@ main() { Box originalBox = box; // Should parse as: // box = (box..x = (a.value == 21 ? b : c)..x.test(117)); - box = - box - ..x = a.value == 21 ? b : c - ..x.test(117); + box = box + ..x = a.value == 21 ? b : c + ..x.test(117); Expect.equals(originalBox, box); Expect.equals(box.value, b); // New cascades are allowed inside an expressionWithoutCascade if properly // delimited. box - ..x = - (a - ..set(42) - ..test(42)) + ..x = (a + ..set(42) + ..test(42)) ..x.test(42); } diff --git a/tests/language/class/cyclic_class_member_test.dart b/tests/language/class/cyclic_class_member_test.dart index 616a3d356db..db51cb84d8a 100644 --- a/tests/language/class/cyclic_class_member_test.dart +++ b/tests/language/class/cyclic_class_member_test.dart @@ -5,9 +5,9 @@ // Test that class with a cyclic hierarchy doesn't cause a loop in dart2js. class A extends A { -// ^ -// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE -// [cfe] 'A' is a supertype of itself. + // ^ + // [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE + // [cfe] 'A' is a supertype of itself. // When checking that foo isn't overriding an instance method in the // superclass, dart2js might loop. diff --git a/tests/language/class_modifiers/base/base_class_extend_not_base_final_error_test.dart b/tests/language/class_modifiers/base/base_class_extend_not_base_final_error_test.dart index 61565c9090c..74102a36fd8 100644 --- a/tests/language/class_modifiers/base/base_class_extend_not_base_final_error_test.dart +++ b/tests/language/class_modifiers/base/base_class_extend_not_base_final_error_test.dart @@ -16,4 +16,3 @@ class BOutside extends BaseClass {} // ^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED // [cfe] The type 'BOutside' must be 'base', 'final' or 'sealed' because the supertype 'BaseClass' is 'base'. - diff --git a/tests/language/class_modifiers/base/base_class_implement_error_test.dart b/tests/language/class_modifiers/base/base_class_implement_error_test.dart index 85462529fc6..42a2c2c6e50 100644 --- a/tests/language/class_modifiers/base/base_class_implement_error_test.dart +++ b/tests/language/class_modifiers/base/base_class_implement_error_test.dart @@ -22,4 +22,3 @@ enum EnumOutside implements ClassForEnum { x } // ^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY // [cfe] The class 'ClassForEnum' can't be implemented outside of its library because it's a base class. - diff --git a/tests/language/class_modifiers/base/base_class_inside_not_base_final_sealed_error_test.dart b/tests/language/class_modifiers/base/base_class_inside_not_base_final_sealed_error_test.dart index 38a4ad5086c..71285ad6a36 100644 --- a/tests/language/class_modifiers/base/base_class_inside_not_base_final_sealed_error_test.dart +++ b/tests/language/class_modifiers/base/base_class_inside_not_base_final_sealed_error_test.dart @@ -68,4 +68,3 @@ class IndirectSubtype extends SubtypeOfBase {} // ^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED // [cfe] The type 'IndirectSubtype' must be 'base', 'final' or 'sealed' because the supertype 'BaseClass' is 'base'. - diff --git a/tests/language/class_modifiers/base/base_mixin_implement_error_test.dart b/tests/language/class_modifiers/base/base_mixin_implement_error_test.dart index 327c9aaf38d..215ac7ec9fa 100644 --- a/tests/language/class_modifiers/base/base_mixin_implement_error_test.dart +++ b/tests/language/class_modifiers/base/base_mixin_implement_error_test.dart @@ -22,4 +22,3 @@ enum EnumOutside implements MixinForEnum { x } // ^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY // [cfe] The mixin 'MixinForEnum' can't be implemented outside of its library because it's a base mixin. - diff --git a/tests/language/class_modifiers/base/base_mixin_with_not_base_final_error_test.dart b/tests/language/class_modifiers/base/base_mixin_with_not_base_final_error_test.dart index e757583f142..6679f11628d 100644 --- a/tests/language/class_modifiers/base/base_mixin_with_not_base_final_error_test.dart +++ b/tests/language/class_modifiers/base/base_mixin_with_not_base_final_error_test.dart @@ -16,4 +16,3 @@ class BOutside with BaseMixin {} // ^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED // [cfe] The type 'BOutside' must be 'base', 'final' or 'sealed' because the supertype 'BaseMixin' is 'base'. - diff --git a/tests/language/class_modifiers/final/final_class_implement_outside_error_test.dart b/tests/language/class_modifiers/final/final_class_implement_outside_error_test.dart index 15bf39f98a0..d231abf17ab 100644 --- a/tests/language/class_modifiers/final/final_class_implement_outside_error_test.dart +++ b/tests/language/class_modifiers/final/final_class_implement_outside_error_test.dart @@ -22,4 +22,3 @@ enum EnumOutside implements ClassForEnum { x } // ^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY // [cfe] The class 'ClassForEnum' can't be implemented outside of its library because it's a final class. - diff --git a/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart b/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart index 27145e379f2..56dcfd441a4 100644 --- a/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart +++ b/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart @@ -49,4 +49,3 @@ class IndirectSubtype extends SubtypeOfFinal {} // ^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED // [cfe] The type 'IndirectSubtype' must be 'base', 'final' or 'sealed' because the supertype 'FinalClass' is 'final'. - diff --git a/tests/language/class_modifiers/interface/interface_class_typedef_extend_error_test.dart b/tests/language/class_modifiers/interface/interface_class_typedef_extend_error_test.dart index 66b8cf01f00..f54bd333410 100644 --- a/tests/language/class_modifiers/interface/interface_class_typedef_extend_error_test.dart +++ b/tests/language/class_modifiers/interface/interface_class_typedef_extend_error_test.dart @@ -11,4 +11,3 @@ class ATypeDef extends InterfaceClassTypeDef {} // ^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY // [cfe] The class 'InterfaceClass' can't be extended outside of its library because it's an interface class. - diff --git a/tests/language/class_modifiers/interface/interface_class_typedef_used_outside_error_test.dart b/tests/language/class_modifiers/interface/interface_class_typedef_used_outside_error_test.dart index 2dcf0aeebb0..aa7d8a4621c 100644 --- a/tests/language/class_modifiers/interface/interface_class_typedef_used_outside_error_test.dart +++ b/tests/language/class_modifiers/interface/interface_class_typedef_used_outside_error_test.dart @@ -14,4 +14,3 @@ class A extends ATypeDef {} // ^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY // [cfe] The class 'InterfaceClass' can't be extended outside of its library because it's an interface class. - diff --git a/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_generative_constructor_error_test.dart b/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_generative_constructor_error_test.dart index f092846e914..b1c10a375d3 100644 --- a/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_generative_constructor_error_test.dart +++ b/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_generative_constructor_error_test.dart @@ -18,4 +18,3 @@ abstract class AbstractClassMixingCtorClass with GenerativeConstructorClass {} // [cfe] Can't use 'GenerativeConstructorClass' as a mixin because it has constructors. // ^^^^^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR - diff --git a/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_superclass_not_object_error_test.dart b/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_superclass_not_object_error_test.dart index 5e7461e5cc6..3c93dd2d99f 100644 --- a/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_superclass_not_object_error_test.dart +++ b/tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_superclass_not_object_error_test.dart @@ -18,4 +18,3 @@ abstract class AbstractMixinClass with NonObjectSuperclassClass {} // ^^^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT // [cfe] The class 'NonObjectSuperclassClass' can't be used as a mixin because it extends a class other than 'Object'. - diff --git a/tests/language/class_modifiers/mixin/mixin_class_no_modifier_outside_library_error_test.dart b/tests/language/class_modifiers/mixin/mixin_class_no_modifier_outside_library_error_test.dart index bc9afb32034..8bf3aa8fcd3 100644 --- a/tests/language/class_modifiers/mixin/mixin_class_no_modifier_outside_library_error_test.dart +++ b/tests/language/class_modifiers/mixin/mixin_class_no_modifier_outside_library_error_test.dart @@ -40,4 +40,3 @@ class OutsideG with AbstractClass {} // ^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN // [cfe] The class 'AbstractClass' can't be used as a mixin because it isn't a mixin class nor a mixin. - diff --git a/tests/language/closure/closures_with_complex_params_test.dart b/tests/language/closure/closures_with_complex_params_test.dart index d626d5147f1..175999acfff 100644 --- a/tests/language/closure/closures_with_complex_params_test.dart +++ b/tests/language/closure/closures_with_complex_params_test.dart @@ -47,12 +47,10 @@ test3() { var f2 = (Pair> pr) => pr.snd.fst + 2; // Closures with function type with nested parameterized types. - var ap1 = - (f(Pair> pr1), Pair> pr) => - f(pr) * 10; - var ap2 = - (f(Pair> pr1), Pair> pr) => - f(pr) * 100; + var ap1 = (f(Pair> pr1), Pair> pr) => + f(pr) * 10; + var ap2 = (f(Pair> pr1), Pair> pr) => + f(pr) * 100; var e = new Pair>(100, new Pair(200, 300)); diff --git a/tests/language/closure/with_super_field_test.dart b/tests/language/closure/with_super_field_test.dart index 603c0f6f4b6..9dfc91f57d2 100644 --- a/tests/language/closure/with_super_field_test.dart +++ b/tests/language/closure/with_super_field_test.dart @@ -12,7 +12,8 @@ class A { class B extends A { int get a => 54; returnSuper() => super.a; - returnSuperInClosure() => () => super.a; + returnSuperInClosure() => + () => super.a; } main() { diff --git a/tests/language/compile_time_constant/compile_time_constant11_test.dart b/tests/language/compile_time_constant/compile_time_constant11_test.dart index 7a4d1dfa9f9..ddd8c8635c7 100644 --- a/tests/language/compile_time_constant/compile_time_constant11_test.dart +++ b/tests/language/compile_time_constant/compile_time_constant11_test.dart @@ -9,21 +9,19 @@ import "package:expect/expect.dart"; const C1 = true; const C2 = false; -const nephew = - C1 - ? C2 - ? "Tick" - : "Trick" - : "Track"; +const nephew = C1 + ? C2 + ? "Tick" + : "Trick" + : "Track"; main() { const a = true ? 5 : 10; - const b = - C2 - ? "Track" - : C1 - ? "Trick" - : "Tick"; + const b = C2 + ? "Track" + : C1 + ? "Trick" + : "Tick"; Expect.equals(5, a); Expect.equals("Trick", nephew); diff --git a/tests/language/const/instantiated_function_constant_test.dart b/tests/language/const/instantiated_function_constant_test.dart index 0242fc50b12..abb1d78955b 100644 --- a/tests/language/const/instantiated_function_constant_test.dart +++ b/tests/language/const/instantiated_function_constant_test.dart @@ -59,12 +59,11 @@ class A { x3 = b ? ((b ? prefix.f1 : f2)) : ((b ? prefix.f1 : f2)), x4 = b ? ((b ? c01 : prefix.c02)) : ((b ? c01 : prefix.c02)), x5 = b ? (null ?? f1) : (null ?? f1), - x6 = - b - ? ((c01 as dynamic) - as void Function(X, [num, List])) - : ((c01 as dynamic) - as void Function(X, [num, List])), + x6 = b + ? ((c01 as dynamic) + as void Function(X, [num, List])) + : ((c01 as dynamic) + as void Function(X, [num, List])), x7 = b ? f1 : f2, x8 = b ? c01 : c02, x9 = null ?? c02, diff --git a/tests/language/constants_2018/type_check_test.dart b/tests/language/constants_2018/type_check_test.dart index 169bf45fa7e..3c3ab4e8572 100644 --- a/tests/language/constants_2018/type_check_test.dart +++ b/tests/language/constants_2018/type_check_test.dart @@ -29,10 +29,9 @@ class T { const T.length2(dynamic l, int defaultValue) : value = l is! String ? defaultValue : l.length; const T.sum(dynamic o1, dynamic o2) - : value = - ((o1 is num) & (o2 is num)) | ((o1 is String) & (o2 is String)) - ? o1 + o2 - : o1; + : value = ((o1 is num) & (o2 is num)) | ((o1 is String) & (o2 is String)) + ? o1 + o2 + : o1; } class C { diff --git a/tests/language/constructor/constructor_contexts_test.dart b/tests/language/constructor/constructor_contexts_test.dart index f5244b689af..eee134872f5 100644 --- a/tests/language/constructor/constructor_contexts_test.dart +++ b/tests/language/constructor/constructor_contexts_test.dart @@ -409,7 +409,9 @@ class AllocatorContextNormalParamAndTypeParamCapturedInBodyAndTypeParamInInitial Function f2; int a; - AllocatorContextNormalParamAndTypeParamCapturedInBodyAndTypeParamInInitializer(int a) : this.a = a, + AllocatorContextNormalParamAndTypeParamCapturedInBodyAndTypeParamInInitializer( + int a, + ) : this.a = a, f1 = (() { Expect.identical(T, int); }), @@ -439,7 +441,9 @@ class AllocatorContextNormalParamAndTypeParamCapturedInBodyAndNormalParamInIniti Function f2; int a; - AllocatorContextNormalParamAndTypeParamCapturedInBodyAndNormalParamInInitializer(int a) : this.a = a, + AllocatorContextNormalParamAndTypeParamCapturedInBodyAndNormalParamInInitializer( + int a, + ) : this.a = a, f1 = (() { a++; Expect.equals(++expectedValueOfA, a); @@ -1005,9 +1009,10 @@ void main() { expectedValueOfA = 123; AllocatorContextNormalParamCapturedInBodyAndNormalAndTypeParamInInitializer - k = AllocatorContextNormalParamCapturedInBodyAndNormalAndTypeParamInInitializer< - int - >(expectedValueOfA); + k = + AllocatorContextNormalParamCapturedInBodyAndNormalAndTypeParamInInitializer< + int + >(expectedValueOfA); k.runAssertions(); expectedValueOfA = 123; @@ -1019,14 +1024,18 @@ void main() { expectedValueOfA = 123; AllocatorContextNormalParamAndTypeParamCapturedInBodyAndTypeParamInInitializer - m = AllocatorContextNormalParamAndTypeParamCapturedInBodyAndTypeParamInInitializer< - int - >(expectedValueOfA); + m = + AllocatorContextNormalParamAndTypeParamCapturedInBodyAndTypeParamInInitializer< + int + >(expectedValueOfA); m.runAssertions(); expectedValueOfA = 123; AllocatorContextNormalParamAndTypeParamCapturedInBodyAndNormalParamInInitializer - n = AllocatorContextNormalParamAndTypeParamCapturedInBodyAndNormalParamInInitializer(expectedValueOfA); + n = + AllocatorContextNormalParamAndTypeParamCapturedInBodyAndNormalParamInInitializer< + int + >(expectedValueOfA); n.runAssertions(); expectedValueOfA = 123; diff --git a/tests/language/covariant/subtyping_test.dart b/tests/language/covariant/subtyping_test.dart index 7a8342be13e..f590c163efc 100644 --- a/tests/language/covariant/subtyping_test.dart +++ b/tests/language/covariant/subtyping_test.dart @@ -116,8 +116,8 @@ testFieldOfFunctionType() { } testFieldOfGenericFunctionType() { - FnChecks c = - new FnChecks()..g = (S s) => s.isNegative; + FnChecks c = new FnChecks() + ..g = (S s) => s.isNegative; Expect.throwsTypeError(() { G g = c.g; diff --git a/tests/language/double_literals/implicit_double_context_test.dart b/tests/language/double_literals/implicit_double_context_test.dart index aee4122116e..c997efac471 100644 --- a/tests/language/double_literals/implicit_double_context_test.dart +++ b/tests/language/double_literals/implicit_double_context_test.dart @@ -431,13 +431,11 @@ main() { Expect.identical(0.0, v1); v2 = 1..toString(); Expect.identical(1.0, v2); - v3 = - -0 - ..toString(); + v3 = -0 + ..toString(); Expect.identical(-0.0, v3); - v4 = - -1 - ..toString(); + v4 = -1 + ..toString(); Expect.identical(-1.0, v4); v5 = 9223372036854775808..toString(); Expect.identical(9223372036854775808.0, v5); @@ -445,9 +443,8 @@ main() { Expect.identical(18446744073709551616.0, v6); v7 = 0x02..toString(); // Hex literal. Expect.identical(2.0, v7); - v8 = - -0x02 - ..toString(); // Hex literal. + v8 = -0x02 + ..toString(); // Hex literal. Expect.identical(-2.0, v8); // Nexted context, double assignment. @@ -554,9 +551,8 @@ main() { { // Check that the correct value is used as receiver for the cascade. var collector = StringBuffer(); - double tricky = - -42 - ..toString().codeUnits.forEach(collector.writeCharCode); + double tricky = -42 + ..toString().codeUnits.forEach(collector.writeCharCode); Expect.equals("${-42.0}", collector.toString()); } @@ -566,8 +562,11 @@ main() { // The context type of "4.toString..." is not double, and the `-` // is not having a literal as operand. Expect.throws(() { - double tricky = - -4.toString().codeUnits.firstWhere((c) => !isDigit(c)).toDouble(); + double tricky = -4 + .toString() + .codeUnits + .firstWhere((c) => !isDigit(c)) + .toDouble(); }); } diff --git a/tests/language/export/ambiguous_main_test.dart b/tests/language/export/ambiguous_main_test.dart index a52cd4fefa8..4b135bc7fe2 100644 --- a/tests/language/export/ambiguous_main_test.dart +++ b/tests/language/export/ambiguous_main_test.dart @@ -4,7 +4,8 @@ export 'ambiguous_main_a.dart'; export 'ambiguous_main_b.dart'; -// [error column 1] + +// [error line 6, column 1] // [cfe] 'main' is exported from both 'tests/language/export/ambiguous_main_a.dart' and 'tests/language/export/ambiguous_main_b.dart'. -// ^^^^^^^^^^^^^^^^^^^^^^^ +// [error line 6, column 8] // [analyzer] COMPILE_TIME_ERROR.AMBIGUOUS_EXPORT diff --git a/tests/language/extension_methods/null_aware_promotion_test.dart b/tests/language/extension_methods/null_aware_promotion_test.dart index 35dc25a573c..ff28b880251 100644 --- a/tests/language/extension_methods/null_aware_promotion_test.dart +++ b/tests/language/extension_methods/null_aware_promotion_test.dart @@ -38,12 +38,13 @@ testVariable(C? c) { E(c)?.extensionProperty = c..expectStaticType>(); E(c)?.extensionProperty += c..expectStaticType>(); E(c)?.nullableExtensionProperty ??= c..expectStaticType>(); - E(c)?[c - ..expectStaticType>()].method(c..expectStaticType>()); + E(c)?[c..expectStaticType>()].method( + c..expectStaticType>(), + ); E(c)?[c..expectStaticType>()] = c..expectStaticType>(); E(c)?[c..expectStaticType>()] += c..expectStaticType>(); - E2(c)?[c..expectStaticType>()] ??= - c..expectStaticType>(); + E2(c)?[c..expectStaticType>()] ??= c + ..expectStaticType>(); } testProperty(B b) { @@ -55,12 +56,12 @@ testProperty(B b) { E(b._c)?[b._c..expectStaticType>()].method( b._c..expectStaticType>(), ); - E(b._c)?[b._c..expectStaticType>()] = - b._c..expectStaticType>(); - E(b._c)?[b._c..expectStaticType>()] += - b._c..expectStaticType>(); - E2(b._c)?[b._c..expectStaticType>()] ??= - b._c..expectStaticType>(); + E(b._c)?[b._c..expectStaticType>()] = b._c + ..expectStaticType>(); + E(b._c)?[b._c..expectStaticType>()] += b._c + ..expectStaticType>(); + E2(b._c)?[b._c..expectStaticType>()] ??= b._c + ..expectStaticType>(); } main() { diff --git a/tests/language/extension_methods/static_extension_resolution_7_test.dart b/tests/language/extension_methods/static_extension_resolution_7_test.dart index 64bb9765415..13b8ae72d55 100644 --- a/tests/language/extension_methods/static_extension_resolution_7_test.dart +++ b/tests/language/extension_methods/static_extension_resolution_7_test.dart @@ -7,7 +7,8 @@ import "package:expect/expect.dart"; // Tests the resolution of a bare type variable with bounded or promoted type. extension E on T { - T Function(T) get f => (_) => this; + T Function(T) get f => + (_) => this; } class A { diff --git a/tests/language/extension_type/extension_type_representation_type_test.dart b/tests/language/extension_type/extension_type_representation_type_test.dart index c01a5fbb914..b399f1428e2 100644 --- a/tests/language/extension_type/extension_type_representation_type_test.dart +++ b/tests/language/extension_type/extension_type_representation_type_test.dart @@ -112,7 +112,10 @@ void main() { V32(({int x = 0, String y = "0"}) {})._; V33((int x, {required String y}) {})._; V34(({required int x, String y = "0"}) {})._; - V35(() => (Function f) => f)._; + V35( + () => + (Function f) => f, + )._; V36(int)._; V37([int])._; V38(int)._; diff --git a/tests/language/extension_type/match_against_non_extension_types_in_inference_test.dart b/tests/language/extension_type/match_against_non_extension_types_in_inference_test.dart index 9e46d517ddc..6c6b3a24192 100644 --- a/tests/language/extension_type/match_against_non_extension_types_in_inference_test.dart +++ b/tests/language/extension_type/match_against_non_extension_types_in_inference_test.dart @@ -46,10 +46,9 @@ String Function(E) producingFunctionE() => ((E e) => ""); // In type constraint generation, E is compared against ET2, // yielding the constraint String <: T. -test4() => - acceptingFunctionET2( - producingFunctionE(), - ).expectStaticType>(); +test4() => acceptingFunctionET2( + producingFunctionE(), +).expectStaticType>(); extension type ET3(A it) implements ET1 {} @@ -81,10 +80,9 @@ T acceptingFunctionET4(Function(ET4) f) => f(ET4(producingE())); // In type constraint generation, E is compared against ET4, // yielding the constraint String <: T. -test8() => - acceptingFunctionET4( - producingFunctionE(), - ).expectStaticType>(); +test8() => acceptingFunctionET4( + producingFunctionE(), +).expectStaticType>(); main() { test1(); diff --git a/tests/language/extension_type/why_not_promoted_implements_error_test.dart b/tests/language/extension_type/why_not_promoted_implements_error_test.dart index 00a114e0a6f..92961860255 100644 --- a/tests/language/extension_type/why_not_promoted_implements_error_test.dart +++ b/tests/language/extension_type/why_not_promoted_implements_error_test.dart @@ -71,15 +71,15 @@ class C3 { } class C4 implements C3 { -// ^^ -// [context 6] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder -// [context 12] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder -// [context 18] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder -// [context 24] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder -// [context 30] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. -// [context 36] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. -// [context 42] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. -// [context 48] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. + // ^^ + // [context 6] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder + // [context 12] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder + // [context 18] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder + // [context 24] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. See http://dart.dev/go/non-promo-conflicting-noSuchMethod-forwarder + // [context 30] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. + // [context 36] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. + // [context 42] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. + // [context 48] '_conflictingNsmForwarder' couldn't be promoted because there is a conflicting noSuchMethod forwarder in class 'C4'. noSuchMethod(invocation) => 0; } diff --git a/tests/language/extension_type/why_not_promoted_representation_error_test.dart b/tests/language/extension_type/why_not_promoted_representation_error_test.dart index a89c89fe65f..2f09a73b1e5 100644 --- a/tests/language/extension_type/why_not_promoted_representation_error_test.dart +++ b/tests/language/extension_type/why_not_promoted_representation_error_test.dart @@ -7,15 +7,15 @@ // context message. extension type E(int? i) { -// ^ -// [context 1] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field -// [context 2] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field -// [context 3] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field -// [context 4] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field -// [context 5] 'i' refers to a public property so it couldn't be promoted. -// [context 6] 'i' refers to a public property so it couldn't be promoted. -// [context 7] 'i' refers to a public property so it couldn't be promoted. -// [context 8] 'i' refers to a public property so it couldn't be promoted. + // ^ + // [context 1] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field + // [context 2] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field + // [context 3] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field + // [context 4] 'i' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field + // [context 5] 'i' refers to a public property so it couldn't be promoted. + // [context 6] 'i' refers to a public property so it couldn't be promoted. + // [context 7] 'i' refers to a public property so it couldn't be promoted. + // [context 8] 'i' refers to a public property so it couldn't be promoted. void viaImplicitThis() { if (i != null) { i.isEven; diff --git a/tests/language/regress_54994_test.dart b/tests/language/regress_54994_test.dart index 49d89b85b0d..4fb91526e41 100644 --- a/tests/language/regress_54994_test.dart +++ b/tests/language/regress_54994_test.dart @@ -27,18 +27,18 @@ void test1() { } void test2() { - final B1 a = - kTrue - ? (B1() as B1) - : (B2() as B1); + final B1 a = kTrue + ? (B1() as B1) + : (B2() as B1); Expect.isFalse(a is B2); Expect.isFalse(a is B2); Expect.isFalse(a is B2); // Should be optimized to cid-range check. } void test3() { - final B1 a = - kTrue ? (B1() as B1) : (B2() as B1); + final B1 a = kTrue + ? (B1() as B1) + : (B2() as B1); Expect.isFalse(a is B2); Expect.isFalse(a is B2); Expect.isFalse(a is B2); @@ -66,8 +66,9 @@ void test6() { } void test7() { - final B1, List> a = - kTrue ? B2>() : B1, List>(); + final B1, List> a = kTrue + ? B2>() + : B1, List>(); Expect.isTrue(a is B2>); // Should be optimized to cid-range check. Expect.isTrue(a is B2>); // Should be optimized to cid-range check. Expect.isFalse(a is B2>); @@ -82,8 +83,9 @@ class X { } void test2() { - final B1, List> a = - kTrue ? B2>() : B1, List>(); + final B1, List> a = kTrue + ? B2>() + : B1, List>(); Expect.isTrue(a is B2>); // Should be optimized to cid-range check. Expect.isTrue( a is B2>, diff --git a/tests/language/static_weak_reference_function_apply_test.dart b/tests/language/static_weak_reference_function_apply_test.dart index 3a9e6fe0913..feaf4b841e0 100644 --- a/tests/language/static_weak_reference_function_apply_test.dart +++ b/tests/language/static_weak_reference_function_apply_test.dart @@ -14,9 +14,12 @@ typedef GG = FF Function(); @pragma('weak-tearoff-reference') GG? weakRef(GG? x) => x; -FF foo1() => ({int x = 100, int y = 10}) => 1000 + x + y; -FF foo2() => ({int x = 200, int y = 20}) => 2000 + x + y; -FF foo3() => ({int x = 300, int y = 30}) => 3000 + x + y; +FF foo1() => + ({int x = 100, int y = 10}) => 1000 + x + y; +FF foo2() => + ({int x = 200, int y = 20}) => 2000 + x + y; +FF foo3() => + ({int x = 300, int y = 30}) => 3000 + x + y; main() { print(foo1()());