Skip to content

Commit 752a913

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/language/argument.
Change-Id: Ic7c2599c878edf2509f53e6033ed5d60eb38a07a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399630 Reviewed-by: Lasse Nielsen <[email protected]> Commit-Queue: Bob Nystrom <[email protected]> Auto-Submit: Bob Nystrom <[email protected]>
1 parent 562af5d commit 752a913

10 files changed

+74
-280
lines changed

tests/language/argument/assignability_function_typed_runtime_4_test.dart

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/language/argument/assignability_function_typed_runtime_5_test.dart

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/language/argument/assignability_function_typed_runtime_6_test.dart

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/language/argument/assignability_function_typed_runtime_7_test.dart

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/language/argument/assignability_function_typed_runtime_test.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// TODO(multitest): This was automatically migrated from a multitest and may
2-
// contain strange or dead code.
3-
41
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
52
// for details. All rights reserved. Use of this source code is governed by a
63
// BSD-style license that can be found in the LICENSE file.
@@ -22,19 +19,16 @@ num objectToNum(Object x) => 0;
2219
main() {
2320
// Unrelated types (not assignable)
2421

25-
26-
2722
// Assignable but fails at runtime.
2823
var intToObject2 = intToObject;
2924

3025
var intToNum2 = intToNum;
3126

3227
var numToObject2 = numToObject;
3328

34-
3529
// Ok
36-
37-
38-
39-
30+
f(numToNum);
31+
f(numToInt);
32+
f(objectToNum);
33+
f(objectToInt);
4034
}

tests/language/argument/named_in_const_creation_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import "package:expect/expect.dart";
77
class A {
88
final x;
99
final y;
10-
const A(a, {b})
11-
: x = a,
12-
y = b;
10+
const A(a, {b}) : x = a, y = b;
1311
static const test = const A(1, b: 2);
1412
}
1513

tests/language/argument/not_enough_positional_arguments_test.dart renamed to tests/language/argument/not_enough_positional_arguments_error_test.dart

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,19 @@ class A {
1212
}
1313

1414
class B {
15-
B()
16-
: super.test(b: 1)
17-
//^^^^^^^^^^^^^^^^
18-
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER
19-
// [cfe] Superclass has no constructor named 'Object.test'.
20-
;
15+
B() : super.test(b: 1);
16+
// ^^^^^^^^^^^^^^^^
17+
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER
18+
// [cfe] Superclass has no constructor named 'Object.test'.
2119
}
2220

2321
class C extends A {
24-
C()
25-
: super.test(b: 1)
26-
// ^
27-
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
28-
// ^^^^^^
29-
// [cfe] Too few positional arguments: 1 required, 0 given.
30-
// ^
31-
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_NAMED_PARAMETER
32-
;
22+
C() : super.test(b: 1);
23+
// ^
24+
// [cfe] Too few positional arguments: 1 required, 0 given.
25+
// ^
26+
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
27+
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_NAMED_PARAMETER
3328
}
3429

3530
class D {
@@ -38,41 +33,53 @@ class D {
3833
}
3934

4035
class E extends D {
41-
E()
42-
: super.test(b: 1)
43-
// ^
44-
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
45-
// ^^^^^^
46-
// [cfe] Too few positional arguments: 1 required, 0 given.
47-
;
36+
E() : super.test(b: 1);
37+
// ^
38+
// [cfe] Too few positional arguments: 1 required, 0 given.
39+
// ^
40+
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
41+
}
42+
43+
class F {
44+
F(a);
45+
}
46+
47+
class G extends F {}
48+
// ^
49+
// [analyzer] COMPILE_TIME_ERROR.NO_DEFAULT_SUPER_CONSTRUCTOR
50+
// [cfe] The superclass, 'F', has no unnamed constructor that takes no arguments.
51+
52+
class H extends F {
53+
H();
54+
// [error column 3, length 1]
55+
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS
56+
// [cfe] The implicitly called unnamed constructor from 'F' has required parameters.
4857
}
4958

5059
main() {
5160
new A.test(b: 1);
52-
// ^
53-
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
54-
// ^^^^^^
61+
// ^
5562
// [cfe] Too few positional arguments: 1 required, 0 given.
5663
// ^
64+
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
5765
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_NAMED_PARAMETER
5866
new B();
5967
new C();
6068
new D.test(b: 1);
69+
// ^
70+
// [cfe] Too few positional arguments: 1 required, 0 given.
6171
// ^
6272
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
63-
// ^^^^^^
64-
// [cfe] Too few positional arguments: 1 required, 0 given.
6573
new E();
6674
foo(b: 1);
67-
// ^
68-
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
69-
// ^^^^^^
75+
// ^
7076
// [cfe] Too few positional arguments: 1 required, 0 given.
7177
// ^
78+
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
7279
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_NAMED_PARAMETER
7380
bar(b: 1);
81+
// ^
82+
// [cfe] Too few positional arguments: 1 required, 0 given.
7483
// ^
7584
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
76-
// ^^^^^^
77-
// [cfe] Too few positional arguments: 1 required, 0 given.
7885
}

tests/language/argument/not_enough_positional_runtime_test.dart

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)