Skip to content

Commit 1c24e58

Browse files
munificentCommit Queue
authored andcommitted
Format tests/language/m*.
Change-Id: I325ac267e5d1d1beb882e7cf08bbd7bfb99138ca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408980 Auto-Submit: Bob Nystrom <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]>
1 parent 3f71a43 commit 1c24e58

File tree

109 files changed

+785
-878
lines changed

Some content is hidden

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

109 files changed

+785
-878
lines changed

tests/language/malbounded/instantiation_runtime_test.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,4 @@
77

88
class Super<T extends num> {}
99

10-
11-
12-
main() {
13-
14-
15-
16-
}
10+
main() {}

tests/language/malbounded/instantiation_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
class Super<T extends num> {}
6+
67
class Malbounded1 implements Super<String> {}
78
// ^
89
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
910
// ^^^^^^
1011
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
12+
1113
class Malbounded2 extends Super<String> {}
1214
// ^
1315
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.

tests/language/malbounded/type_cast_runtime_test.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,16 @@
88
import 'package:expect/expect.dart';
99

1010
class Super<T extends num> {}
11-
class Malbounded1 implements Super
1211

13-
{}
14-
class Malbounded2 extends Super
12+
class Malbounded1 implements Super {}
1513

16-
{}
14+
class Malbounded2 extends Super {}
1715

1816
main() {
1917
var m = new Malbounded1();
2018
Expect.throwsTypeError(() => m as Super<int>);
2119
var s = new Super<int>();
2220
Expect.throwsTypeError(() => s as Malbounded1);
2321
Expect.throwsTypeError(() => s as Malbounded2);
24-
s as Super
25-
26-
;
22+
s as Super;
2723
}

tests/language/malbounded/type_cast_test.dart

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,28 @@
55
import 'package:expect/expect.dart';
66

77
class Super<T extends num> {}
8-
class Malbounded1 implements Super
8+
9+
class Malbounded1 implements Super<String> {}
910
// ^
1011
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
11-
<String>
12-
// ^^^^^^
12+
// ^^^^^^
1313
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
14-
{}
15-
class Malbounded2 extends Super
14+
15+
class Malbounded2 extends Super<String> {}
1616
// ^
1717
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
18-
<String>
19-
// ^^^^^^
18+
// ^^^^^^
2019
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
21-
{}
2220

2321
main() {
2422
var m = new Malbounded1();
2523
Expect.throwsTypeError(() => m as Super<int>);
2624
var s = new Super<int>();
2725
Expect.throwsTypeError(() => s as Malbounded1);
2826
Expect.throwsTypeError(() => s as Malbounded2);
29-
s as Super
27+
s as Super<String>;
3028
// ^
3129
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
32-
<String>
33-
// ^^^^^^
34-
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
35-
;
30+
// ^^^^^^
31+
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
3632
}

tests/language/malbounded/type_literal_runtime_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import 'package:expect/expect.dart';
99

1010
class Super<T extends num> {}
1111

12-
class Malbounded extends Super
13-
14-
{}
12+
class Malbounded extends Super {}
1513

1614
main() {
1715
Type t = Malbounded;

tests/language/malbounded/type_literal_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ import 'package:expect/expect.dart';
66

77
class Super<T extends num> {}
88

9-
class Malbounded extends Super
9+
class Malbounded extends Super<String> {}
1010
// ^
1111
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
12-
<String>
13-
// ^^^^^^
12+
// ^^^^^^
1413
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
15-
{}
1614

1715
main() {
1816
Type t = Malbounded;

tests/language/malbounded/type_test2_runtime_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class A<T extends num> {}
1111

1212
class B<T> {
1313
test() {
14-
new A() is A
15-
16-
;
14+
new A() is A;
1715
}
1816
}
1917

tests/language/malbounded/type_test2_test.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ class A<T extends num> {}
88

99
class B<T> {
1010
test() {
11-
new A() is A
11+
new A() is A<T>;
1212
// ^
1313
// [cfe] Type argument 'T' doesn't conform to the bound 'num' of the type variable 'T' on 'A'.
14-
<T>
15-
// ^
16-
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
17-
;
14+
// ^
15+
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
1816
}
1917
}
2018

tests/language/malbounded/type_test_runtime_test.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,15 @@ import 'package:expect/expect.dart';
99

1010
class Super<T extends num> {}
1111

12-
class Malbounded1 implements Super
12+
class Malbounded1 implements Super {}
1313

14-
{}
15-
16-
class Malbounded2 extends Super
17-
18-
{}
14+
class Malbounded2 extends Super {}
1915

2016
main() {
2117
var m = new Malbounded1();
2218
Expect.isFalse(m is Super<int>);
2319
var s = new Super<int>();
2420
Expect.isFalse(s is Malbounded1);
2521
Expect.isFalse(s is Malbounded2);
26-
Expect.isTrue(s is Super
27-
28-
);
22+
Expect.isTrue(s is Super);
2923
}

tests/language/malbounded/type_test_test.dart

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,27 @@ import 'package:expect/expect.dart';
66

77
class Super<T extends num> {}
88

9-
class Malbounded1 implements Super
9+
class Malbounded1 implements Super<String> {}
1010
// ^
1111
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
12-
<String>
13-
// ^^^^^^
12+
// ^^^^^^
1413
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
15-
{}
1614

17-
class Malbounded2 extends Super
15+
class Malbounded2 extends Super<String> {}
1816
// ^
1917
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
20-
<String>
21-
// ^^^^^^
18+
// ^^^^^^
2219
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
23-
{}
2420

2521
main() {
2622
var m = new Malbounded1();
2723
Expect.isFalse(m is Super<int>);
2824
var s = new Super<int>();
2925
Expect.isFalse(s is Malbounded1);
3026
Expect.isFalse(s is Malbounded2);
31-
Expect.isTrue(s is Super
27+
Expect.isTrue(s is Super<String>);
3228
// ^
3329
// [cfe] Type argument 'String' doesn't conform to the bound 'num' of the type variable 'T' on 'Super'.
34-
<String>
35-
// ^^^^^^
36-
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
37-
);
30+
// ^^^^^^
31+
// [analyzer] COMPILE_TIME_ERROR.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
3832
}

0 commit comments

Comments
 (0)