Skip to content

Commit 6cc9efe

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/language/c*.
Change-Id: I94dfcea40566190c6bf153c108b0d0d5dbf27a4d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400148 Commit-Queue: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]>
1 parent 7190cb0 commit 6cc9efe

File tree

248 files changed

+42717
-42738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+42717
-42738
lines changed

tests/language/call/function_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ void main() {
4444
var s = (FooType).toString();
4545
var minified = s != 'FooType'; // dart2js --minify has minified names.
4646
dynamic d = null;
47-
Expect.throws(() => d(),
48-
(e) => e is NoSuchMethodError && (minified || '$e'.contains('call')));
47+
Expect.throws(
48+
() => d(),
49+
(e) => e is NoSuchMethodError && (minified || '$e'.contains('call')),
50+
);
4951
}

tests/language/call/implicit_tearoff_assignment_test.dart

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ class Derived extends Base {
4848
}
4949

5050
void testSuperPropertySet() {
51-
Expect.type<void Function()>((super.baseProperty = C())
52-
..expectStaticType<Exactly<void Function()>>());
51+
Expect.type<void Function()>(
52+
(super.baseProperty = C())..expectStaticType<Exactly<void Function()>>(),
53+
);
5354
Expect.type<void Function()>(super._basePropertySetValue);
5455
}
5556
}
@@ -72,56 +73,64 @@ extension on Extended {
7273
void testExtensionIndexSet() {
7374
Extended e = Extended();
7475
Expect.type<void Function()>(
75-
(e[0] = C())..expectStaticType<Exactly<void Function()>>());
76+
(e[0] = C())..expectStaticType<Exactly<void Function()>>(),
77+
);
7678
Expect.type<void Function()>(e._extensionIndexSetValue);
7779
}
7880

7981
void testExtensionSet() {
8082
Extended e = Extended();
81-
Expect.type<void Function()>((e.extensionProperty = C())
82-
..expectStaticType<Exactly<void Function()>>());
83+
Expect.type<void Function()>(
84+
(e.extensionProperty = C())..expectStaticType<Exactly<void Function()>>(),
85+
);
8386
Expect.type<void Function()>(e._extensionPropertySetValue);
8487
}
8588

8689
void testIndexSet() {
8790
Derived d = Derived();
8891
Expect.type<void Function()>(
89-
(d[0] = C())..expectStaticType<Exactly<void Function()>>());
92+
(d[0] = C())..expectStaticType<Exactly<void Function()>>(),
93+
);
9094
Expect.type<void Function()>(d._indexSetValue);
9195
}
9296

9397
void testInstanceSet() {
9498
Derived d = Derived();
9599
Expect.type<void Function()>(
96-
(d.instanceProperty = C())..expectStaticType<Exactly<void Function()>>());
100+
(d.instanceProperty = C())..expectStaticType<Exactly<void Function()>>(),
101+
);
97102
Expect.type<void Function()>(d._instanceSetValue);
98103
}
99104

100105
void testNullAwarePropertySet() {
101106
Derived? d = Derived() as Derived?; // ignore: unnecessary_cast
102-
Expect.type<void Function()>((d?.instanceProperty = C())
103-
..expectStaticType<Exactly<void Function()?>>());
107+
Expect.type<void Function()>(
108+
(d?.instanceProperty = C())..expectStaticType<Exactly<void Function()?>>(),
109+
);
104110
Expect.type<void Function()>(d!._instanceSetValue);
105111
}
106112

107113
void testStaticSet() {
108114
C._staticPropertySetValue = null;
109115
Expect.type<void Function()>(
110-
(C.staticProperty = C())..expectStaticType<Exactly<void Function()>>());
116+
(C.staticProperty = C())..expectStaticType<Exactly<void Function()>>(),
117+
);
111118
Expect.type<void Function()>(C._staticPropertySetValue);
112119
}
113120

114121
void testTopLevelSet() {
115122
_topLevelPropertySetValue = null;
116123
Expect.type<void Function()>(
117-
(topLevelProperty = C())..expectStaticType<Exactly<void Function()>>());
124+
(topLevelProperty = C())..expectStaticType<Exactly<void Function()>>(),
125+
);
118126
Expect.type<void Function()>(_topLevelPropertySetValue);
119127
}
120128

121129
void testVariableSet() {
122130
void Function() f;
123131
Expect.type<void Function()>(
124-
(f = C())..expectStaticType<Exactly<void Function()>>());
132+
(f = C())..expectStaticType<Exactly<void Function()>>(),
133+
);
125134
Expect.type<void Function()>(f);
126135
}
127136

tests/language/call/implicit_tearoff_exceptions_test.dart

Lines changed: 69 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,39 @@ void testConditional() {
6262
// `(bTrue ? c : a)..expectStaticType<...>()`, no implicit tearoff of `c`
6363
// occurs, and the subexpression `bTrue ? c : a` gets assigned a static type
6464
// of `A`.
65-
Expect.throws(() => context<void Function()>(
66-
bFalse ? d : ((bTrue ? c : a)..expectStaticType<Exactly<A>>())));
67-
Expect.throws(() => context<void Function()>(
68-
bFalse ? d : ((bFalse ? a : c)..expectStaticType<Exactly<A>>())));
65+
Expect.throws(
66+
() => context<void Function()>(
67+
bFalse ? d : ((bTrue ? c : a)..expectStaticType<Exactly<A>>()),
68+
),
69+
);
70+
Expect.throws(
71+
() => context<void Function()>(
72+
bFalse ? d : ((bFalse ? a : c)..expectStaticType<Exactly<A>>()),
73+
),
74+
);
6975

7076
// Same as above, but confirm that extra parens around `c` don't change the
7177
// behavior.
72-
Expect.throws(() => context<void Function()>(
73-
bFalse ? d : ((bTrue ? (c) : a)..expectStaticType<Exactly<A>>())));
74-
Expect.throws(() => context<void Function()>(
75-
bFalse ? d : ((bFalse ? a : (c))..expectStaticType<Exactly<A>>())));
76-
Expect.throws(() => context<void Function()>(
77-
bFalse ? d : ((bTrue ? ((c)) : a)..expectStaticType<Exactly<A>>())));
78-
Expect.throws(() => context<void Function()>(
79-
bFalse ? d : ((bFalse ? a : ((c)))..expectStaticType<Exactly<A>>())));
78+
Expect.throws(
79+
() => context<void Function()>(
80+
bFalse ? d : ((bTrue ? (c) : a)..expectStaticType<Exactly<A>>()),
81+
),
82+
);
83+
Expect.throws(
84+
() => context<void Function()>(
85+
bFalse ? d : ((bFalse ? a : (c))..expectStaticType<Exactly<A>>()),
86+
),
87+
);
88+
Expect.throws(
89+
() => context<void Function()>(
90+
bFalse ? d : ((bTrue ? ((c)) : a)..expectStaticType<Exactly<A>>()),
91+
),
92+
);
93+
Expect.throws(
94+
() => context<void Function()>(
95+
bFalse ? d : ((bFalse ? a : ((c)))..expectStaticType<Exactly<A>>()),
96+
),
97+
);
8098
}
8199

82100
void testIfNull() {
@@ -90,30 +108,51 @@ void testIfNull() {
90108
// appropriate). So, in
91109
// `(c ?? a)..expectStaticType<...>()`, no implicit tearoff of `c` occurs, and
92110
// the subexpression `c ?? a` gets assigned a static type of `A`.
93-
Expect.throws(() => context<void Function()>(bFalse
94-
? d
95-
: ((c ?? a) // ignore: dead_null_aware_expression
96-
..expectStaticType<Exactly<A>>())));
111+
Expect.throws(
112+
() => context<void Function()>(
113+
bFalse
114+
? d
115+
: ((c ?? a) // ignore: dead_null_aware_expression
116+
..expectStaticType<Exactly<A>>()),
117+
),
118+
);
97119

98120
// In `(aq ?? c)..expectStaticType<...>()`, the situation is similar, but the
99121
// context for `c` is (non-nullable) `void Function()`.
100-
Expect.throws(() => context<void Function()>(
101-
bFalse ? d : ((aq ?? c)..expectStaticType<Exactly<A>>())));
122+
Expect.throws(
123+
() => context<void Function()>(
124+
bFalse ? d : ((aq ?? c)..expectStaticType<Exactly<A>>()),
125+
),
126+
);
102127

103128
// Same as above, but confirm that extra parens around `c` don't change the
104129
// behavior.
105-
Expect.throws(() => context<void Function()>(bFalse
106-
? d
107-
: (((c) ?? a) // ignore: dead_null_aware_expression
108-
..expectStaticType<Exactly<A>>())));
109-
Expect.throws(() => context<void Function()>(
110-
bFalse ? d : ((aq ?? (c))..expectStaticType<Exactly<A>>())));
111-
Expect.throws(() => context<void Function()>(bFalse
112-
? d
113-
: ((((c)) ?? a) // ignore: dead_null_aware_expression
114-
..expectStaticType<Exactly<A>>())));
115-
Expect.throws(() => context<void Function()>(
116-
bFalse ? d : ((aq ?? ((c)))..expectStaticType<Exactly<A>>())));
130+
Expect.throws(
131+
() => context<void Function()>(
132+
bFalse
133+
? d
134+
: (((c) ?? a) // ignore: dead_null_aware_expression
135+
..expectStaticType<Exactly<A>>()),
136+
),
137+
);
138+
Expect.throws(
139+
() => context<void Function()>(
140+
bFalse ? d : ((aq ?? (c))..expectStaticType<Exactly<A>>()),
141+
),
142+
);
143+
Expect.throws(
144+
() => context<void Function()>(
145+
bFalse
146+
? d
147+
: ((((c)) ?? a) // ignore: dead_null_aware_expression
148+
..expectStaticType<Exactly<A>>()),
149+
),
150+
);
151+
Expect.throws(
152+
() => context<void Function()>(
153+
bFalse ? d : ((aq ?? ((c)))..expectStaticType<Exactly<A>>()),
154+
),
155+
);
117156
}
118157

119158
main() {

tests/language/call/implicit_tearoff_type_variable_error_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ void testTypeVariablePromotedToNullableCallableClass<T>(T t) {
3636
}
3737

3838
void testTypeVariableExtendsNullableTypeVariable<T extends U?, U extends C>(
39-
T t) {
39+
T t,
40+
) {
4041
context<void Function()>(t);
4142
// ^
4243
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE

tests/language/call/method_implicit_invoke_local_legacy_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ main() {
3232
Expect.equals(d2(1), 2);
3333
// Cannot invoke with the wrong signature.
3434
c2();
35+
//^
36+
// [cfe] Too few positional arguments: 1 required, 0 given.
3537
// ^
3638
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
37-
//^^
38-
// [cfe] Too few positional arguments: 1 required, 0 given.
3939
c2(3, 4);
40+
//^
41+
// [cfe] Too many positional arguments: 1 allowed, but 2 found.
4042
// ^
4143
// [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS
42-
//^^^^^^
43-
// [cfe] Too many positional arguments: 1 allowed, but 2 found.
4444
}

tests/language/call/method_implicit_invoke_local_runtime_1_legacy_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ main() {
3434
// Implicitly invokes d2.call(1)
3535

3636
// Cannot invoke with the wrong signature.
37-
38-
3937
}

tests/language/call/method_implicit_invoke_local_runtime_1_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,4 @@ main() {
3131
// Implicitly invokes d2.call(1)
3232

3333
// Cannot invoke with the wrong signature.
34-
35-
3634
}

tests/language/call/method_implicit_invoke_local_runtime_2_legacy_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ main() {
3434
// Implicitly invokes d2.call(1)
3535

3636
// Cannot invoke with the wrong signature.
37-
38-
3937
}

tests/language/call/method_implicit_invoke_local_runtime_2_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,4 @@ main() {
3131
// Implicitly invokes d2.call(1)
3232

3333
// Cannot invoke with the wrong signature.
34-
35-
3634
}

tests/language/call/method_implicit_invoke_local_runtime_3_legacy_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ main() {
3434
// Implicitly invokes d2.call(1)
3535

3636
// Cannot invoke with the wrong signature.
37-
38-
3937
}

0 commit comments

Comments
 (0)