@@ -30,179 +30,178 @@ interface Invariant<T> {
30
30
>T : Symbol(T, Decl(conditionalTypes2.ts, 8, 20))
31
31
}
32
32
33
- interface A { a: string }
34
- >A : Symbol(A, Decl(conditionalTypes2.ts, 10, 1))
35
- >a : Symbol(A.a, Decl(conditionalTypes2.ts, 12, 13))
36
-
37
- interface B extends A { b: string }
38
- >B : Symbol(B, Decl(conditionalTypes2.ts, 12, 25))
39
- >A : Symbol(A, Decl(conditionalTypes2.ts, 10, 1))
40
- >b : Symbol(B.b, Decl(conditionalTypes2.ts, 13, 23))
41
-
42
-
43
- function f1(a: Covariant<A>, b: Covariant<B>) {
44
- >f1 : Symbol(f1, Decl(conditionalTypes2.ts, 13, 35))
45
- >a : Symbol(a, Decl(conditionalTypes2.ts, 16, 12))
33
+ function f1<A, B extends A>(a: Covariant<A>, b: Covariant<B>) {
34
+ >f1 : Symbol(f1, Decl(conditionalTypes2.ts, 10, 1))
35
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 12, 12))
36
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 12, 14))
37
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 12, 12))
38
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 12, 28))
46
39
>Covariant : Symbol(Covariant, Decl(conditionalTypes2.ts, 0, 0))
47
- >A : Symbol(A, Decl(conditionalTypes2.ts, 10, 1 ))
48
- >b : Symbol(b, Decl(conditionalTypes2.ts, 16, 28 ))
40
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 12, 12 ))
41
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 12, 44 ))
49
42
>Covariant : Symbol(Covariant, Decl(conditionalTypes2.ts, 0, 0))
50
- >B : Symbol(B, Decl(conditionalTypes2.ts, 12, 25 ))
43
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 12, 14 ))
51
44
52
45
a = b;
53
- >a : Symbol(a, Decl(conditionalTypes2.ts, 16, 12 ))
54
- >b : Symbol(b, Decl(conditionalTypes2.ts, 16, 28 ))
46
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 12, 28 ))
47
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 12, 44 ))
55
48
56
49
b = a; // Error
57
- >b : Symbol(b, Decl(conditionalTypes2.ts, 16, 28 ))
58
- >a : Symbol(a, Decl(conditionalTypes2.ts, 16, 12 ))
50
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 12, 44 ))
51
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 12, 28 ))
59
52
}
60
53
61
- function f2(a: Contravariant<A>, b: Contravariant<B>) {
62
- >f2 : Symbol(f2, Decl(conditionalTypes2.ts, 19, 1))
63
- >a : Symbol(a, Decl(conditionalTypes2.ts, 21, 12))
54
+ function f2<A, B extends A>(a: Contravariant<A>, b: Contravariant<B>) {
55
+ >f2 : Symbol(f2, Decl(conditionalTypes2.ts, 15, 1))
56
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 17, 12))
57
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 17, 14))
58
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 17, 12))
59
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 17, 28))
64
60
>Contravariant : Symbol(Contravariant, Decl(conditionalTypes2.ts, 2, 1))
65
- >A : Symbol(A, Decl(conditionalTypes2.ts, 10, 1 ))
66
- >b : Symbol(b, Decl(conditionalTypes2.ts, 21, 32 ))
61
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 17, 12 ))
62
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 17, 48 ))
67
63
>Contravariant : Symbol(Contravariant, Decl(conditionalTypes2.ts, 2, 1))
68
- >B : Symbol(B, Decl(conditionalTypes2.ts, 12, 25 ))
64
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 17, 14 ))
69
65
70
66
a = b; // Error
71
- >a : Symbol(a, Decl(conditionalTypes2.ts, 21, 12 ))
72
- >b : Symbol(b, Decl(conditionalTypes2.ts, 21, 32 ))
67
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 17, 28 ))
68
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 17, 48 ))
73
69
74
70
b = a;
75
- >b : Symbol(b, Decl(conditionalTypes2.ts, 21, 32 ))
76
- >a : Symbol(a, Decl(conditionalTypes2.ts, 21, 12 ))
71
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 17, 48 ))
72
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 17, 28 ))
77
73
}
78
74
79
- function f3(a: Invariant<A>, b: Invariant<B>) {
80
- >f3 : Symbol(f3, Decl(conditionalTypes2.ts, 24, 1))
81
- >a : Symbol(a, Decl(conditionalTypes2.ts, 26, 12))
75
+ function f3<A, B extends A>(a: Invariant<A>, b: Invariant<B>) {
76
+ >f3 : Symbol(f3, Decl(conditionalTypes2.ts, 20, 1))
77
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 22, 12))
78
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 22, 14))
79
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 22, 12))
80
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 22, 28))
82
81
>Invariant : Symbol(Invariant, Decl(conditionalTypes2.ts, 6, 1))
83
- >A : Symbol(A, Decl(conditionalTypes2.ts, 10, 1 ))
84
- >b : Symbol(b, Decl(conditionalTypes2.ts, 26, 28 ))
82
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 22, 12 ))
83
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 22, 44 ))
85
84
>Invariant : Symbol(Invariant, Decl(conditionalTypes2.ts, 6, 1))
86
- >B : Symbol(B, Decl(conditionalTypes2.ts, 12, 25 ))
85
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 22, 14 ))
87
86
88
87
a = b; // Error
89
- >a : Symbol(a, Decl(conditionalTypes2.ts, 26, 12 ))
90
- >b : Symbol(b, Decl(conditionalTypes2.ts, 26, 28 ))
88
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 22, 28 ))
89
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 22, 44 ))
91
90
92
91
b = a; // Error
93
- >b : Symbol(b, Decl(conditionalTypes2.ts, 26, 28 ))
94
- >a : Symbol(a, Decl(conditionalTypes2.ts, 26, 12 ))
92
+ >b : Symbol(b, Decl(conditionalTypes2.ts, 22, 44 ))
93
+ >a : Symbol(a, Decl(conditionalTypes2.ts, 22, 28 ))
95
94
}
96
95
97
96
// Repros from #22860
98
97
99
98
class Opt<T> {
100
- >Opt : Symbol(Opt, Decl(conditionalTypes2.ts, 29 , 1))
101
- >T : Symbol(T, Decl(conditionalTypes2.ts, 33 , 10))
99
+ >Opt : Symbol(Opt, Decl(conditionalTypes2.ts, 25 , 1))
100
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 29 , 10))
102
101
103
102
toVector(): Vector<T> {
104
- >toVector : Symbol(Opt.toVector, Decl(conditionalTypes2.ts, 33 , 14))
105
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
106
- >T : Symbol(T, Decl(conditionalTypes2.ts, 33 , 10))
103
+ >toVector : Symbol(Opt.toVector, Decl(conditionalTypes2.ts, 29 , 14))
104
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
105
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 29 , 10))
107
106
108
107
return <any>undefined;
109
108
>undefined : Symbol(undefined)
110
109
}
111
110
}
112
111
113
112
interface Seq<T> {
114
- >Seq : Symbol(Seq, Decl(conditionalTypes2.ts, 37 , 1))
115
- >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 14))
113
+ >Seq : Symbol(Seq, Decl(conditionalTypes2.ts, 33 , 1))
114
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 35 , 14))
116
115
117
116
tail(): Opt<Seq<T>>;
118
- >tail : Symbol(Seq.tail, Decl(conditionalTypes2.ts, 39 , 18))
119
- >Opt : Symbol(Opt, Decl(conditionalTypes2.ts, 29 , 1))
120
- >Seq : Symbol(Seq, Decl(conditionalTypes2.ts, 37 , 1))
121
- >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 14))
117
+ >tail : Symbol(Seq.tail, Decl(conditionalTypes2.ts, 35 , 18))
118
+ >Opt : Symbol(Opt, Decl(conditionalTypes2.ts, 25 , 1))
119
+ >Seq : Symbol(Seq, Decl(conditionalTypes2.ts, 33 , 1))
120
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 35 , 14))
122
121
}
123
122
124
123
class Vector<T> implements Seq<T> {
125
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
126
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
127
- >Seq : Symbol(Seq, Decl(conditionalTypes2.ts, 37 , 1))
128
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
124
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
125
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
126
+ >Seq : Symbol(Seq, Decl(conditionalTypes2.ts, 33 , 1))
127
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
129
128
130
129
tail(): Opt<Vector<T>> {
131
- >tail : Symbol(Vector.tail, Decl(conditionalTypes2.ts, 43 , 35))
132
- >Opt : Symbol(Opt, Decl(conditionalTypes2.ts, 29 , 1))
133
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
134
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
130
+ >tail : Symbol(Vector.tail, Decl(conditionalTypes2.ts, 39 , 35))
131
+ >Opt : Symbol(Opt, Decl(conditionalTypes2.ts, 25 , 1))
132
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
133
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
135
134
136
135
return <any>undefined;
137
136
>undefined : Symbol(undefined)
138
137
}
139
138
partition2<U extends T>(predicate:(v:T)=>v is U): [Vector<U>,Vector<Exclude<T, U>>];
140
- >partition2 : Symbol(Vector.partition2, Decl(conditionalTypes2.ts, 46 , 5), Decl(conditionalTypes2.ts, 47 , 88), Decl(conditionalTypes2.ts, 48 , 64))
141
- >U : Symbol(U, Decl(conditionalTypes2.ts, 47 , 15))
142
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
143
- >predicate : Symbol(predicate, Decl(conditionalTypes2.ts, 47 , 28))
144
- >v : Symbol(v, Decl(conditionalTypes2.ts, 47 , 39))
145
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
146
- >v : Symbol(v, Decl(conditionalTypes2.ts, 47 , 39))
147
- >U : Symbol(U, Decl(conditionalTypes2.ts, 47 , 15))
148
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
149
- >U : Symbol(U, Decl(conditionalTypes2.ts, 47 , 15))
150
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
139
+ >partition2 : Symbol(Vector.partition2, Decl(conditionalTypes2.ts, 42 , 5), Decl(conditionalTypes2.ts, 43 , 88), Decl(conditionalTypes2.ts, 44 , 64))
140
+ >U : Symbol(U, Decl(conditionalTypes2.ts, 43 , 15))
141
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
142
+ >predicate : Symbol(predicate, Decl(conditionalTypes2.ts, 43 , 28))
143
+ >v : Symbol(v, Decl(conditionalTypes2.ts, 43 , 39))
144
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
145
+ >v : Symbol(v, Decl(conditionalTypes2.ts, 43 , 39))
146
+ >U : Symbol(U, Decl(conditionalTypes2.ts, 43 , 15))
147
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
148
+ >U : Symbol(U, Decl(conditionalTypes2.ts, 43 , 15))
149
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
151
150
>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --))
152
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
153
- >U : Symbol(U, Decl(conditionalTypes2.ts, 47 , 15))
151
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
152
+ >U : Symbol(U, Decl(conditionalTypes2.ts, 43 , 15))
154
153
155
154
partition2(predicate:(x:T)=>boolean): [Vector<T>,Vector<T>];
156
- >partition2 : Symbol(Vector.partition2, Decl(conditionalTypes2.ts, 46 , 5), Decl(conditionalTypes2.ts, 47 , 88), Decl(conditionalTypes2.ts, 48 , 64))
157
- >predicate : Symbol(predicate, Decl(conditionalTypes2.ts, 48 , 15))
158
- >x : Symbol(x, Decl(conditionalTypes2.ts, 48 , 26))
159
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
160
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
161
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
162
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
163
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
155
+ >partition2 : Symbol(Vector.partition2, Decl(conditionalTypes2.ts, 42 , 5), Decl(conditionalTypes2.ts, 43 , 88), Decl(conditionalTypes2.ts, 44 , 64))
156
+ >predicate : Symbol(predicate, Decl(conditionalTypes2.ts, 44 , 15))
157
+ >x : Symbol(x, Decl(conditionalTypes2.ts, 44 , 26))
158
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
159
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
160
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
161
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
162
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
164
163
165
164
partition2<U extends T>(predicate:(v:T)=>boolean): [Vector<U>,Vector<any>] {
166
- >partition2 : Symbol(Vector.partition2, Decl(conditionalTypes2.ts, 46 , 5), Decl(conditionalTypes2.ts, 47 , 88), Decl(conditionalTypes2.ts, 48 , 64))
167
- >U : Symbol(U, Decl(conditionalTypes2.ts, 49 , 15))
168
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
169
- >predicate : Symbol(predicate, Decl(conditionalTypes2.ts, 49 , 28))
170
- >v : Symbol(v, Decl(conditionalTypes2.ts, 49 , 39))
171
- >T : Symbol(T, Decl(conditionalTypes2.ts, 43 , 13))
172
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
173
- >U : Symbol(U, Decl(conditionalTypes2.ts, 49 , 15))
174
- >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 41 , 1))
165
+ >partition2 : Symbol(Vector.partition2, Decl(conditionalTypes2.ts, 42 , 5), Decl(conditionalTypes2.ts, 43 , 88), Decl(conditionalTypes2.ts, 44 , 64))
166
+ >U : Symbol(U, Decl(conditionalTypes2.ts, 45 , 15))
167
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
168
+ >predicate : Symbol(predicate, Decl(conditionalTypes2.ts, 45 , 28))
169
+ >v : Symbol(v, Decl(conditionalTypes2.ts, 45 , 39))
170
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 39 , 13))
171
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
172
+ >U : Symbol(U, Decl(conditionalTypes2.ts, 45 , 15))
173
+ >Vector : Symbol(Vector, Decl(conditionalTypes2.ts, 37 , 1))
175
174
176
175
return <any>undefined;
177
176
>undefined : Symbol(undefined)
178
177
}
179
178
}
180
179
181
180
interface A1<T> {
182
- >A1 : Symbol(A1, Decl(conditionalTypes2.ts, 52 , 1))
183
- >T : Symbol(T, Decl(conditionalTypes2.ts, 54 , 13))
181
+ >A1 : Symbol(A1, Decl(conditionalTypes2.ts, 48 , 1))
182
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 50 , 13))
184
183
185
184
bat: B1<A1<T>>;
186
- >bat : Symbol(A1.bat, Decl(conditionalTypes2.ts, 54 , 17))
187
- >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 56 , 1))
188
- >A1 : Symbol(A1, Decl(conditionalTypes2.ts, 52 , 1))
189
- >T : Symbol(T, Decl(conditionalTypes2.ts, 54 , 13))
185
+ >bat : Symbol(A1.bat, Decl(conditionalTypes2.ts, 50 , 17))
186
+ >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 52 , 1))
187
+ >A1 : Symbol(A1, Decl(conditionalTypes2.ts, 48 , 1))
188
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 50 , 13))
190
189
}
191
190
192
191
interface B1<T> extends A1<T> {
193
- >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 56 , 1))
194
- >T : Symbol(T, Decl(conditionalTypes2.ts, 58 , 13))
195
- >A1 : Symbol(A1, Decl(conditionalTypes2.ts, 52 , 1))
196
- >T : Symbol(T, Decl(conditionalTypes2.ts, 58 , 13))
192
+ >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 52 , 1))
193
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 54 , 13))
194
+ >A1 : Symbol(A1, Decl(conditionalTypes2.ts, 48 , 1))
195
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 54 , 13))
197
196
198
197
bat: B1<B1<T>>;
199
- >bat : Symbol(B1.bat, Decl(conditionalTypes2.ts, 58 , 31))
200
- >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 56 , 1))
201
- >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 56 , 1))
202
- >T : Symbol(T, Decl(conditionalTypes2.ts, 58 , 13))
198
+ >bat : Symbol(B1.bat, Decl(conditionalTypes2.ts, 54 , 31))
199
+ >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 52 , 1))
200
+ >B1 : Symbol(B1, Decl(conditionalTypes2.ts, 52 , 1))
201
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 54 , 13))
203
202
204
203
boom: T extends any ? true : true
205
- >boom : Symbol(B1.boom, Decl(conditionalTypes2.ts, 59 , 19))
206
- >T : Symbol(T, Decl(conditionalTypes2.ts, 58 , 13))
204
+ >boom : Symbol(B1.boom, Decl(conditionalTypes2.ts, 55 , 19))
205
+ >T : Symbol(T, Decl(conditionalTypes2.ts, 54 , 13))
207
206
}
208
207
0 commit comments