Skip to content

Commit 3379826

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/language/v-z* using 3.8 style.
Change-Id: I781aabc6acc4f0341659380ed6cd169d66edce4e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425346 Commit-Queue: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]>
1 parent d3904f5 commit 3379826

File tree

66 files changed

+1155
-1334
lines changed

Some content is hidden

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

66 files changed

+1155
-1334
lines changed

tests/language/value_class/has_non_final_field_error_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'value_class_support_lib.dart';
99
@valueClass
1010
class Animal {
1111
int numberOfLegs;
12-
//^
13-
// [cfe] unspecified
12+
// ^^^^^^^^^^^^
13+
// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD
14+
// [cfe] Field 'numberOfLegs' should be initialized because its type 'int' doesn't allow null.
1415
}

tests/language/variable/bad_initializer1_runtime_test.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@
99

1010
main() {
1111
const elems = const [
12-
const [
13-
1,
14-
2.0,
15-
true,
16-
false,
17-
0xffffffffff,
18-
19-
],
12+
const [1, 2.0, true, false, 0xffffffffff],
2013
"a",
21-
"b"
14+
"b",
2215
];
2316
}

tests/language/variable/bad_initializer1_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66

77
main() {
88
const elems = const [
9-
// ^^^^^
10-
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_COMPILE_TIME_CONSTANT
9+
// ^^^^^
10+
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_COMPILE_TIME_CONSTANT
1111
const [
1212
1,
1313
2.0,
1414
true,
1515
false,
1616
0xffffffffff,
17-
elems
18-
// ^^^^^
19-
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
20-
// [cfe] Local variable 'elems' can't be referenced before it is declared.
21-
// [cfe] Undefined name 'elems'.
17+
elems,
18+
// [error column 7, length 5]
19+
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
20+
// [cfe] Local variable 'elems' can't be referenced before it is declared.
21+
// [cfe] Undefined name 'elems'.
2222
],
2323
"a",
24-
"b"
24+
"b",
2525
];
2626
}

tests/language/variable/bad_initializer2_runtime_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ main() {
1313
if (n == 0) {
1414
return 0;
1515
} else {
16-
return 1
17-
18-
;
16+
return 1;
1917
}
2018
};
2119
foo(1);

tests/language/variable/bad_initializer2_test.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ main() {
1010
if (n == 0) {
1111
return 0;
1212
} else {
13-
return 1
14-
+ foo(n - 1)
15-
//^^^
16-
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
17-
// [cfe] Local variable 'foo' can't be referenced before it is declared.
18-
// [cfe] Method not found: 'foo'.
19-
;
13+
return 1 + foo(n - 1);
14+
// ^^^
15+
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
16+
// [cfe] Local variable 'foo' can't be referenced before it is declared.
17+
// [cfe] Method not found: 'foo'.
2018
}
2119
};
2220
foo(1);
23-
//^
24-
// [cfe] Method not found: 'foo'.
21+
// [error column 3]
22+
// [cfe] Method not found: 'foo'.
2523
}

tests/language/variable/duplicate_field_with_initializer_runtime_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
class Repeated {
99
var a = '', b = 'Something';
10-
1110
}
1211

1312
main() {}

tests/language/variable/illegal_initializer_runtime_test.dart

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,15 @@ class A {
1111
}
1212

1313
class B extends A {
14-
B.c1()
15-
: super.foo
16-
17-
()
18-
19-
;
14+
B.c1() : super.foo();
2015

2116
B.foo();
22-
B.c2()
23-
: this.foo
24-
25-
()
26-
27-
;
17+
B.c2() : this.foo();
2818

29-
B.c3()
30-
: super
31-
32-
()
33-
34-
;
19+
B.c3() : super();
3520

3621
B();
37-
B.c4()
38-
: this
39-
40-
()
41-
42-
;
22+
B.c4() : this();
4323
}
4424

4525
main() {

tests/language/variable/illegal_initializer_test.dart

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ class B extends A {
1717
B.c2() : this.foo;
1818
// ^^^^
1919
// [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS
20-
// [cfe] Can't access 'this' in a field initializer.
21-
// ^^^^
2220
// [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER
23-
// [cfe] Expected an assignment after the field name.
2421
// ^^^^^^^^
2522
// [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD
23+
// [cfe] Can't access 'this' in a field initializer.
24+
// [cfe] Expected an assignment after the field name.
2625
// ^^^
2726
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
2827

@@ -39,15 +38,12 @@ class B extends A {
3938
B.c4() : this;
4039
// ^^^^
4140
// [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD
42-
// [cfe] Expected an assignment after the field name.
43-
// ^^^^
4441
// [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS
45-
// ^^^^
4642
// [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER
47-
// [error line 39, column 16, length 0]
48-
// [cfe] Expected '.' before this.
43+
// [cfe] Expected an assignment after the field name.
4944
// ^
5045
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
46+
// [cfe] Expected '.' before this.
5147
// [cfe] Expected an identifier, but got ''.
5248
}
5349

tests/language/variable/initializer_super_last_runtime_test.dart

Lines changed: 45 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -17,119 +17,67 @@ class S {
1717

1818
class C extends S {
1919
final int x;
20-
C.cc01(int x)
21-
: x = x,
22-
super();
23-
C.cc02(int x)
24-
: x = x,
25-
super.named();
20+
C.cc01(int x) : x = x, super();
21+
C.cc02(int x) : x = x, super.named();
2622
C.cc03(this.x) : super();
2723
C.cc04(this.x) : super.named();
28-
C.cc05(int x)
29-
: x = x,
30-
assert(x == x),
31-
super();
32-
C.cc06(int x)
33-
: x = x,
34-
assert(x == x),
35-
super.named();
36-
C.cc07(this.x)
37-
: assert(x == x),
38-
super();
39-
C.cc08(this.x)
40-
: assert(x == x),
41-
super.named();
24+
C.cc05(int x) : x = x, assert(x == x), super();
25+
C.cc06(int x) : x = x, assert(x == x), super.named();
26+
C.cc07(this.x) : assert(x == x), super();
27+
C.cc08(this.x) : assert(x == x), super.named();
4228
C.cc09(int x)
43-
: //
44-
45-
x = x;
29+
: //
30+
x = x;
4631
C.cc10(int x)
47-
: //
48-
49-
x = x;
32+
: //
33+
x = x;
5034
C.cc11(this.x)
51-
: //
52-
53-
assert(x == x);
35+
: //
36+
assert(x == x);
5437
C.cc12(this.x)
55-
: //
56-
57-
assert(x == x);
38+
: //
39+
assert(x == x);
5840
C.cc13(int x)
59-
: //
60-
61-
x = x,
62-
assert(x == x);
41+
: //
42+
x = x,
43+
assert(x == x);
6344
C.cc14(int x)
64-
: //
65-
66-
x = x,
67-
assert(x == x);
68-
C.cc15(int x)
69-
: x = x,
70-
71-
assert(x == x);
72-
C.cc16(int x)
73-
: x = x,
74-
75-
assert(x == x);
76-
77-
const C.cc17(int x)
78-
: x = x,
79-
super();
80-
const C.cc18(int x)
81-
: x = x,
82-
super.named();
45+
: //
46+
x = x,
47+
assert(x == x);
48+
C.cc15(int x) : x = x, assert(x == x);
49+
C.cc16(int x) : x = x, assert(x == x);
50+
51+
const C.cc17(int x) : x = x, super();
52+
const C.cc18(int x) : x = x, super.named();
8353
const C.cc19(this.x) : super();
8454
const C.cc20(this.x) : super.named();
85-
const C.cc21(int x)
86-
: x = x,
87-
assert(x == x),
88-
super();
89-
const C.cc22(int x)
90-
: x = x,
91-
assert(x == x),
92-
super.named();
93-
const C.cc23(this.x)
94-
: assert(x == x),
95-
super();
96-
const C.cc24(this.x)
97-
: assert(x == x),
98-
super.named();
55+
const C.cc21(int x) : x = x, assert(x == x), super();
56+
const C.cc22(int x) : x = x, assert(x == x), super.named();
57+
const C.cc23(this.x) : assert(x == x), super();
58+
const C.cc24(this.x) : assert(x == x), super.named();
9959
const C.cc25(int x)
100-
: //
101-
102-
x = x;
60+
: //
61+
x = x;
10362
const C.cc26(int x)
104-
: //
105-
106-
x = x;
63+
: //
64+
x = x;
10765
const C.cc27(this.x)
108-
: //
109-
110-
assert(x == x);
66+
: //
67+
assert(x == x);
11168
const C.cc28(this.x)
112-
: //
113-
114-
assert(x == x);
69+
: //
70+
assert(x == x);
11571
const C.cc29(int x)
116-
: //
117-
118-
x = x,
119-
assert(x == x);
72+
: //
73+
x = x,
74+
assert(x == x);
12075
const C.cc30(int x)
121-
: //
122-
123-
x = x,
124-
assert(x == x);
125-
const C.cc31(int x)
126-
: x = x,
127-
128-
assert(x == x);
129-
const C.cc32(int x)
130-
: x = x,
131-
132-
assert(x == x);
76+
: //
77+
x = x,
78+
assert(x == x);
79+
const C.cc31(int x) : x = x, assert(x == x);
80+
const C.cc32(int x) : x = x, assert(x == x);
13381
}
13482

13583
main() {

0 commit comments

Comments
 (0)