Skip to content

Commit c9b0c3f

Browse files
authored
#1400. Composing inline classes tests renumerated (#2078)
1 parent 3fe41c8 commit c9b0c3f

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

LanguageFeatures/Inline-classes/composing_inline_classes_A05_t02.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
/// the two declarations of m are distinct declarations, and DV does not declare
1212
/// a member named m.
1313
///
14-
/// @description Checks that it is not an error if an inline class declaration
15-
/// `DV` has two superinterfaces `V1` and `V2`, where both `V1` and `V2` have a
16-
/// member named `m`, and the two declarations of `m` are distinct
17-
/// declarations, but DV does declare a member named `m`.
14+
/// @description Checks that it is a compile-time error if an inline class
15+
/// declaration `DV` has two superinterfaces `V1` and `V2`, where both `V1` and
16+
/// `V2` have a member named `m`, and the two declarations of `m` are distinct
17+
/// declarations, and DV does not declare a member named `m`. Test the case when
18+
/// members in `V1` and `V2` have equal signatures
1819
/// @author [email protected]
1920
2021
// SharedOptions=--enable-experiment=inline-class
@@ -34,10 +35,11 @@ inline class V2 {
3435
}
3536

3637
inline class V implements V1, V2 {
38+
// ^
39+
// [analyzer] unspecified
40+
// [cfe] unspecified
3741
final int id;
3842
V(this.id);
39-
40-
num get m => 3.14;
4143
}
4244

4345
main() {

LanguageFeatures/Inline-classes/composing_inline_classes_A05_t03.dart

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,27 @@
1919
2020
// SharedOptions=--enable-experiment=inline-class
2121

22-
import "../../Utils/expect.dart";
23-
2422
inline class V1 {
2523
final int id;
2624
V1(this.id);
2725

28-
int get m => 1;
26+
int m() => 1;
2927
}
3028

3129
inline class V2 {
3230
final int id;
3331
V2(this.id);
3432

35-
num m() => 2;
33+
int m() => 2;
3634
}
3735

3836
inline class V implements V1, V2 {
3937
final int id;
4038
V(this.id);
4139

42-
String get m => "42";
40+
num get m => 3.14;
4341
}
4442

4543
main() {
46-
V1 v1 = V(1);
47-
V2 v2 = V(2);
48-
V v = V(3);
49-
Expect.equals(1, v1.m);
50-
Expect.equals(2, v2.m());
51-
Expect.equals("42", v.m);
44+
print(V);
5245
}

LanguageFeatures/Inline-classes/composing_inline_classes_A05_t04.dart

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,42 @@
1111
/// the two declarations of m are distinct declarations, and DV does not declare
1212
/// a member named m.
1313
///
14-
/// @description Checks that it is no an error if an inline class declaration
15-
/// `DV` has two superinterfaces `V1` and `V2`, where both `V1` and `V2` have
16-
/// the same declaration named `m`
14+
/// @description Checks that it is not an error if an inline class declaration
15+
/// `DV` has two superinterfaces `V1` and `V2`, where both `V1` and `V2` have a
16+
/// member named `m`, and the two declarations of `m` are distinct
17+
/// declarations, but DV does declare a member named `m`.
1718
/// @author [email protected]
1819
1920
// SharedOptions=--enable-experiment=inline-class
2021

2122
import "../../Utils/expect.dart";
2223

23-
inline class V1 implements V3 {
24+
inline class V1 {
2425
final int id;
2526
V1(this.id);
27+
28+
int get m => 1;
2629
}
2730

28-
inline class V2 implements V3 {
31+
inline class V2 {
2932
final int id;
3033
V2(this.id);
31-
}
3234

33-
inline class V3 {
34-
num foo() => 42;
35+
num m() => 2;
3536
}
3637

3738
inline class V implements V1, V2 {
3839
final int id;
3940
V(this.id);
41+
42+
String get m => "42";
4043
}
4144

4245
main() {
43-
Expect.equals(42, V(1).foo());
46+
V1 v1 = V(1);
47+
V2 v2 = V(2);
48+
V v = V(3);
49+
Expect.equals(1, v1.m);
50+
Expect.equals(2, v2.m());
51+
Expect.equals("42", v.m);
4452
}

LanguageFeatures/Inline-classes/composing_inline_classes_A05_t05.dart

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,34 @@
1111
/// the two declarations of m are distinct declarations, and DV does not declare
1212
/// a member named m.
1313
///
14-
/// @description Checks that it is a compile-time error if an inline class
15-
/// declaration `DV` has two superinterfaces `V1` and `V2`, where both `V1` and
16-
/// `V2` have a member named `m`, and the two declarations of `m` are distinct
17-
/// declarations, and DV does not declare a member named `m`. Test the case when
18-
/// members in `V1` and `V2` have equal signatures
14+
/// @description Checks that it is no an error if an inline class declaration
15+
/// `DV` has two superinterfaces `V1` and `V2`, where both `V1` and `V2` have
16+
/// the same declaration named `m`
1917
/// @author [email protected]
2018
2119
// SharedOptions=--enable-experiment=inline-class
2220

23-
inline class V1 {
21+
import "../../Utils/expect.dart";
22+
23+
inline class V1 implements V3 {
2424
final int id;
2525
V1(this.id);
26-
27-
int m() => 1;
2826
}
2927

30-
inline class V2 {
28+
inline class V2 implements V3 {
3129
final int id;
3230
V2(this.id);
31+
}
3332

34-
int m() => 2;
33+
inline class V3 {
34+
num foo() => 42;
3535
}
3636

3737
inline class V implements V1, V2 {
38-
// ^
39-
// [analyzer] unspecified
40-
// [cfe] unspecified
4138
final int id;
4239
V(this.id);
4340
}
4441

4542
main() {
46-
print(V);
43+
Expect.equals(42, V(1).foo());
4744
}

0 commit comments

Comments
 (0)