@@ -125,3 +125,93 @@ let x = foo([]); // never
125
125
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 25, 3))
126
126
>foo : Symbol(foo, Decl(strictFunctionTypes1.ts, 20, 30))
127
127
128
+ // Modified repros from #26127
129
+
130
+ interface A { a: string }
131
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
132
+ >a : Symbol(A.a, Decl(strictFunctionTypes1.ts, 29, 13))
133
+
134
+ interface B extends A { b: string }
135
+ >B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
136
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
137
+ >b : Symbol(B.b, Decl(strictFunctionTypes1.ts, 30, 23))
138
+
139
+ declare function acceptUnion(x: A | number): void;
140
+ >acceptUnion : Symbol(acceptUnion, Decl(strictFunctionTypes1.ts, 30, 35))
141
+ >x : Symbol(x, Decl(strictFunctionTypes1.ts, 32, 29))
142
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
143
+
144
+ declare function acceptA(x: A): void;
145
+ >acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
146
+ >x : Symbol(x, Decl(strictFunctionTypes1.ts, 33, 25))
147
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
148
+
149
+ declare let a: A;
150
+ >a : Symbol(a, Decl(strictFunctionTypes1.ts, 35, 11))
151
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
152
+
153
+ declare let b: B;
154
+ >b : Symbol(b, Decl(strictFunctionTypes1.ts, 36, 11))
155
+ >B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
156
+
157
+ declare function coAndContra<T>(value: T, func: (t: T) => void): T;
158
+ >coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
159
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
160
+ >value : Symbol(value, Decl(strictFunctionTypes1.ts, 38, 32))
161
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
162
+ >func : Symbol(func, Decl(strictFunctionTypes1.ts, 38, 41))
163
+ >t : Symbol(t, Decl(strictFunctionTypes1.ts, 38, 49))
164
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
165
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
166
+
167
+ const t1: A = coAndContra(a, acceptUnion);
168
+ >t1 : Symbol(t1, Decl(strictFunctionTypes1.ts, 40, 5))
169
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
170
+ >coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
171
+ >a : Symbol(a, Decl(strictFunctionTypes1.ts, 35, 11))
172
+ >acceptUnion : Symbol(acceptUnion, Decl(strictFunctionTypes1.ts, 30, 35))
173
+
174
+ const t2: B = coAndContra(b, acceptA);
175
+ >t2 : Symbol(t2, Decl(strictFunctionTypes1.ts, 41, 5))
176
+ >B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
177
+ >coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
178
+ >b : Symbol(b, Decl(strictFunctionTypes1.ts, 36, 11))
179
+ >acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
180
+
181
+ const t3: A = coAndContra(never, acceptA);
182
+ >t3 : Symbol(t3, Decl(strictFunctionTypes1.ts, 42, 5))
183
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
184
+ >coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
185
+ >never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
186
+ >acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
187
+
188
+ declare function coAndContraArray<T>(value: T[], func: (t: T) => void): T[];
189
+ >coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
190
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
191
+ >value : Symbol(value, Decl(strictFunctionTypes1.ts, 44, 37))
192
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
193
+ >func : Symbol(func, Decl(strictFunctionTypes1.ts, 44, 48))
194
+ >t : Symbol(t, Decl(strictFunctionTypes1.ts, 44, 56))
195
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
196
+ >T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
197
+
198
+ const t4: A[] = coAndContraArray([a], acceptUnion);
199
+ >t4 : Symbol(t4, Decl(strictFunctionTypes1.ts, 46, 5))
200
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
201
+ >coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
202
+ >a : Symbol(a, Decl(strictFunctionTypes1.ts, 35, 11))
203
+ >acceptUnion : Symbol(acceptUnion, Decl(strictFunctionTypes1.ts, 30, 35))
204
+
205
+ const t5: B[] = coAndContraArray([b], acceptA);
206
+ >t5 : Symbol(t5, Decl(strictFunctionTypes1.ts, 47, 5))
207
+ >B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
208
+ >coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
209
+ >b : Symbol(b, Decl(strictFunctionTypes1.ts, 36, 11))
210
+ >acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
211
+
212
+ const t6: A[] = coAndContraArray([], acceptA);
213
+ >t6 : Symbol(t6, Decl(strictFunctionTypes1.ts, 48, 5))
214
+ >A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
215
+ >coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
216
+ >acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
217
+
0 commit comments