Skip to content

Commit 01adc34

Browse files
committed
Fixes #946: LanguageFeatures/Instantiate-to-bounds/typedef/static tests updated according to the recent SDK changes.
1 parent cfdac8e commit 01adc34

16 files changed

+286
-90
lines changed

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_FutureOr_l1_t03.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ test(G source) {
5959
var fsource = toF(source);
6060
F<G<FutureOr<dynamic>>> target = fsource;
6161

62-
F<G<FutureOr<Null>>> target1 = fsource;
63-
// ^^^^^^^
62+
F<G<FutureOr<Never>>> target1 = fsource;
63+
// ^^^^^^^
6464
// [analyzer] unspecified
6565
// [cfe] unspecified
6666

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_FutureOr_l1_t04.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ typedef G<X extends FutureOr<X>> = void Function();
5757
test(G source) {
5858
var fsource = toF(source);
5959

60-
F<G<FutureOr<dynamic>>> target = fsource;
61-
F<G<FutureOr<Null>>> target1 = fsource;
62-
F<G<FutureOr<Null>>> target2 = fsource;
60+
F<G<FutureOr<dynamic>>> target1 = fsource;
61+
F<G<FutureOr<Never>>> target2 = fsource;
62+
F<G<FutureOr<Null>>> target3 = fsource;
6363
}
6464

6565
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t03.dart

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,24 @@
4949
*/
5050
// SharedOptions=--enable-experiment=non-nullable
5151

52+
import "../../../../Utils/expect.dart";
53+
5254
class A<X> {}
5355
typedef G<X extends A<X>> = X Function(X);
5456

55-
main() {
56-
G? source;
57-
// ^^^^^^
57+
test(G source) {
58+
var fsource = toF(source);
59+
F<G<A<dynamic>>> target = fsource;
60+
61+
F<G<A<Null>>> target1 = fsource;
62+
// ^^^^^^^
63+
// [analyzer] unspecified
64+
// [cfe] unspecified
65+
66+
F<G<A<Never>>> target2 = fsource;
67+
// ^^^^^^^
5868
// [analyzer] unspecified
5969
// [cfe] unspecified
60-
}
70+
}
71+
72+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t04.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,21 @@
5151
*/
5252
// SharedOptions=--enable-experiment=non-nullable
5353

54+
import "../../../../Utils/expect.dart";
55+
5456
class A<X> {}
5557
typedef G<X extends A<X>> = void Function();
5658

57-
main() {
58-
G? source;
59-
// ^^^^^^^
59+
test(G source) {
60+
var fsource = toF(source);
61+
62+
F<G<A<dynamic>>> target1 = fsource;
63+
F<G<A<Never>>> target2 = fsource;
64+
65+
F<G<A<Null>>> target3 = fsource;
66+
// ^^^^^^^
6067
// [analyzer] unspecified
6168
// [cfe] unspecified
62-
}
69+
}
70+
71+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t05.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,18 @@
5353
class A<X> {}
5454
typedef G<X extends A<X>> = void Function<Y extends X>();
5555

56-
main() {
57-
G? source;
58-
// ^^^^^^
56+
test(G source) {
57+
void Function<X extends A<dynamic>>() target1 = source;
58+
59+
void Function<X extends A<Never>>() target2 = source;
60+
// ^^^^^^
61+
// [analyzer] unspecified
62+
// [cfe] unspecified
63+
64+
void Function<X extends A<Null>>() target3 = source;
65+
// ^^^^^^
5966
// [analyzer] unspecified
6067
// [cfe] unspecified
6168
}
69+
70+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t07.dart

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,66 +54,70 @@ import "../../../../Utils/expect.dart";
5454
class A<X extends A<X>> {}
5555
typedef G<X extends A<X>> = void Function(X);
5656

57-
main() {
58-
G? source;
57+
void test(G source) {
5958
var fsource = toF(source);
6059

61-
F<G<A<Never>>?>? target = fsource;
60+
F<G<A<Never>>> target = fsource;
6261

63-
F<G<A<Never>?>?>? target0 = fsource;
64-
65-
F<G<A<Null>>?>? target0 = fsource;
62+
F<G<A<Never>?>> target0 = fsource;
6663
// ^^^^^^^
6764
// [analyzer] unspecified
6865
// [cfe] unspecified
6966

70-
F<G<A<dynamic>>?>? target1 = fsource;
71-
// ^^^^^^^
67+
F<G<A<Null>>> target1 = fsource;
68+
// ^^^^^^^
7269
// [analyzer] unspecified
7370
// [cfe] unspecified
7471

75-
F<G<A<A<dynamic>>>?>? target2 = fsource;
76-
// ^^^^^^^
72+
F<G<A<dynamic>>> target2 = fsource;
73+
// ^^^^^^^
7774
// [analyzer] unspecified
7875
// [cfe] unspecified
7976

80-
F<G<A<A<A<dynamic>>>>?>? target3 = fsource;
81-
// ^^^^^^^
77+
F<G<A<A<dynamic>>>> target3 = fsource;
78+
// ^^^^^^^
8279
// [analyzer] unspecified
8380
// [cfe] unspecified
8481

85-
F<G<A<A<A<A<dynamic>>>>>?>? target4 = fsource;
86-
// ^^^^^^^
82+
F<G<A<A<A<dynamic>>>>> target4 = fsource;
83+
// ^^^^^^^
8784
// [analyzer] unspecified
8885
// [cfe] unspecified
8986

90-
F<G<A<A<Null>>>?>? target5 = fsource;
91-
// ^^^^^^^
87+
F<G<A<A<A<A<dynamic>>>>>> target5 = fsource;
88+
// ^^^^^^^
9289
// [analyzer] unspecified
9390
// [cfe] unspecified
9491

95-
F<G<A<A<A<Null>>>>?>? target6 = fsource;
96-
// ^^^^^^^
92+
F<G<A<A<Null>>>> target6 = fsource;
93+
// ^^^^^^^
9794
// [analyzer] unspecified
9895
// [cfe] unspecified
9996

100-
F<G<A<A<A<A<Null>>>>>?>? target7 = fsource;
101-
// ^^^^^^^
97+
F<G<A<A<A<Null>>>>> target7 = fsource;
98+
// ^^^^^^^
10299
// [analyzer] unspecified
103100
// [cfe] unspecified
104101

105-
F<G<A<A<Never>>>?>? target8 = fsource;
106-
// ^^^^^^^
102+
F<G<A<A<A<A<Null>>>>>> target8 = fsource;
103+
// ^^^^^^^
107104
// [analyzer] unspecified
108105
// [cfe] unspecified
109106

110-
F<G<A<A<A<Never>>>>?>? target9 = fsource;
111-
// ^^^^^^^
107+
F<G<A<A<Never>>>> target9 = fsource;
108+
// ^^^^^^^
109+
// [analyzer] unspecified
110+
// [cfe] unspecified
111+
112+
F<G<A<A<A<Never>>>>> target10 = fsource;
113+
// ^^^^^^^
112114
// [analyzer] unspecified
113115
// [cfe] unspecified
114116

115-
F<G<A<A<A<A<Never>>>>>?>? target10 = fsource;
116-
// ^^^^^^^
117+
F<G<A<A<A<A<Never>>>>>> target11 = fsource;
118+
// ^^^^^^^
117119
// [analyzer] unspecified
118120
// [cfe] unspecified
119121
}
122+
123+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t08.dart

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,25 @@
5151
*/
5252
// SharedOptions=--enable-experiment=non-nullable
5353

54+
import "../../../../Utils/expect.dart";
55+
5456
class A<X extends A<X>> {}
5557
typedef G<X extends A<X>> = X Function(X);
5658

57-
main() {
58-
G? source;
59-
// ^^^^^^^
59+
test(G source) {
60+
var fsource = toF(source);
61+
F<G<A<dynamic>>> target = fsource;
62+
63+
F<G<A<Null>>> target1 = fsource;
64+
// ^^^^^^^
6065
// [analyzer] unspecified
6166
// [cfe] unspecified
6267

68+
F<G<A<Never>>> target2 = fsource;
69+
// ^^^^^^^
70+
// [analyzer] unspecified
71+
// [cfe] unspecified
6372
}
73+
74+
main() {}
75+

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t09.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,21 @@
5151
*/
5252
// SharedOptions=--enable-experiment=non-nullable
5353

54+
import "../../../../Utils/expect.dart";
55+
5456
class A<X extends A<X>> {}
5557
typedef G<X extends A<X>> = void Function();
5658

57-
main() {
58-
G? source; //# 01: compile-time error
59+
test(G source) {
60+
var fsource = toF(source);
61+
62+
F<G<A<dynamic>>> target1 = fsource;
63+
F<G<A<Never>>> target2 = fsource;
64+
65+
F<G<A<Null>>> target3 = fsource;
66+
// ^^^^^^^
67+
// [analyzer] unspecified
68+
// [cfe] unspecified
5969
}
70+
71+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t10.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,18 @@
5454
class A<X extends A<X>> {}
5555
typedef G<X extends A<X>> = void Function<Y extends X>();
5656

57-
main() {
58-
G? source;
59-
// ^^^^^^^
57+
test(G source) {
58+
void Function<X extends A<dynamic>>() target1 = source;
59+
60+
void Function<X extends A<Never>>() target2 = source;
61+
// ^^^^^^
6062
// [analyzer] unspecified
6163
// [cfe] unspecified
6264

65+
void Function<X extends A<Null>>() target3 = source;
66+
// ^^^^^^
67+
// [analyzer] unspecified
68+
// [cfe] unspecified
6369
}
70+
71+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t13.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,27 @@
5151
import "../../../../Utils/expect.dart";
5252

5353
class A<X> {}
54-
typedef G<X extends A<X>> = void Function(X);
54+
typedef G<X extends A<X>?> = void Function(X);
5555

56-
main() {
57-
G? source;
56+
void testme(G source) {
5857
var fsource = toF(source);
5958

60-
F<G<A<Never>?>?>? target = fsource;
59+
F<G<A<Never>?>> target = fsource;
6160

62-
F<G<A<Never>>?>? target0 = fsource;
63-
// ^^^^^^^
61+
F<G<A<Never>>> target0 = fsource;
62+
// ^^^^^^^
6463
// [analyzer] unspecified
6564
// [cfe] unspecified
6665

67-
F<G<A<dynamic>?>?>? target1 = fsource;
68-
// ^^^^^^^
66+
F<G<A<dynamic>?>> target1 = fsource;
67+
// ^^^^^^^
6968
// [analyzer] unspecified
7069
// [cfe] unspecified
7170

72-
F<G<A<Null>?>?>? target2 = fsource;
73-
// ^^^^^^^
71+
F<G<A<Null>?>> target2 = fsource;
72+
// ^^^^^^^
7473
// [analyzer] unspecified
7574
// [cfe] unspecified
7675
}
76+
77+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t14.dart

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,30 @@
4848
*/
4949
// SharedOptions=--enable-experiment=non-nullable
5050

51-
import "../../../../Utils/expect.dart";
51+
import "../../../../Utils/expect.dart";
5252

53-
class A<X> {}
54-
typedef G<X extends A<X>> = void Function(X?);
53+
class A<X> {}
54+
typedef G<X extends A<X>> = void Function(X?);
5555

56-
main() {
57-
G? source;
58-
var fsource = toF(source);
56+
void testme(G source) {
57+
var fsource = toF(source);
5958

60-
F<G<A<Never>>?>? target = fsource;
59+
F<G<A<Never>>> target = fsource;
6160

62-
F<G<A<Never>?>?>? target0 = fsource;
63-
// ^^^^^^^
61+
F<G<A<Never>?>> target0 = fsource;
62+
// ^^^^^^^
6463
// [analyzer] unspecified
6564
// [cfe] unspecified
6665

67-
F<G<A<dynamic>>?>? target1 = fsource;
68-
// ^^^^^^^
66+
F<G<A<dynamic>>> target1 = fsource;
67+
// ^^^^^^^
6968
// [analyzer] unspecified
7069
// [cfe] unspecified
7170

72-
F<G<A<Null>>?>? target2 = fsource;
73-
// ^^^^^^^
71+
F<G<A<Null>>> target2 = fsource;
72+
// ^^^^^^^
7473
// [analyzer] unspecified
7574
// [cfe] unspecified
76-
}
75+
}
76+
77+
main() {}

LanguageFeatures/Instantiate-to-bound/typedef/static/typedef_l1_t15.dart

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,29 @@
4949
*/
5050
// SharedOptions=--enable-experiment=non-nullable
5151

52+
import "../../../../Utils/expect.dart";
53+
5254
class A<X> {}
5355
typedef G<X extends A<X>?> = X Function(X);
5456

55-
main() {
56-
G? source;
57-
// ^^^^^^
57+
test(G source) {
58+
var fsource = toF(source);
59+
F<G<A<dynamic>?>> target = fsource;
60+
61+
F<G<A<dynamic>>> target0 = fsource;
62+
// ^^^^^^^
63+
// [analyzer] unspecified
64+
// [cfe] unspecified
65+
66+
F<G<A<Null>?>> target1 = fsource;
67+
// ^^^^^^^
5868
// [analyzer] unspecified
5969
// [cfe] unspecified
60-
}
70+
71+
F<G<A<Never>?>> target2 = fsource;
72+
// ^^^^^^^
73+
// [analyzer] unspecified
74+
// [cfe] unspecified
75+
}
76+
77+
main() {}

0 commit comments

Comments
 (0)