You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/baselines/reference/strictFunctionTypesErrors.errors.txt
+30-72
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,15 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(21,1): error TS2322: Type '(x:
17
17
tests/cases/compiler/strictFunctionTypesErrors.ts(23,1): error TS2322: Type '(x: string) => Object' is not assignable to type '(x: string) => string'.
18
18
Type 'Object' is not assignable to type 'string'.
19
19
tests/cases/compiler/strictFunctionTypesErrors.ts(33,1): error TS2322: Type 'Func<string, Object>' is not assignable to type 'Func<Object, Object>'.
20
-
Types of parameters 'x' and 'x' are incompatible.
21
-
Type 'Object' is not assignable to type 'string'.
20
+
Type 'Object' is not assignable to type 'string'.
22
21
tests/cases/compiler/strictFunctionTypesErrors.ts(34,1): error TS2322: Type 'Func<string, string>' is not assignable to type 'Func<Object, Object>'.
23
-
Types of parameters 'x' and 'x' are incompatible.
24
-
Type 'Object' is not assignable to type 'string'.
22
+
Type 'Object' is not assignable to type 'string'.
25
23
tests/cases/compiler/strictFunctionTypesErrors.ts(36,1): error TS2322: Type 'Func<Object, Object>' is not assignable to type 'Func<Object, string>'.
26
24
Type 'Object' is not assignable to type 'string'.
27
25
tests/cases/compiler/strictFunctionTypesErrors.ts(37,1): error TS2322: Type 'Func<string, Object>' is not assignable to type 'Func<Object, string>'.
28
-
Types of parameters 'x' and 'x' are incompatible.
29
-
Type 'Object' is not assignable to type 'string'.
26
+
Type 'Object' is not assignable to type 'string'.
30
27
tests/cases/compiler/strictFunctionTypesErrors.ts(38,1): error TS2322: Type 'Func<string, string>' is not assignable to type 'Func<Object, string>'.
31
-
Types of parameters 'x' and 'x' are incompatible.
32
-
Type 'Object' is not assignable to type 'string'.
28
+
Type 'Object' is not assignable to type 'string'.
33
29
tests/cases/compiler/strictFunctionTypesErrors.ts(44,1): error TS2322: Type 'Func<Object, Object>' is not assignable to type 'Func<string, string>'.
34
30
Type 'Object' is not assignable to type 'string'.
35
31
tests/cases/compiler/strictFunctionTypesErrors.ts(46,1): error TS2322: Type 'Func<string, Object>' is not assignable to type 'Func<string, string>'.
@@ -39,53 +35,36 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(57,1): error TS2322: Type 'Fun
39
35
tests/cases/compiler/strictFunctionTypesErrors.ts(58,1): error TS2322: Type 'Func<Func<string, void>, Object>' is not assignable to type 'Func<Func<Object, void>, string>'.
40
36
Type 'Object' is not assignable to type 'string'.
41
37
tests/cases/compiler/strictFunctionTypesErrors.ts(61,1): error TS2322: Type 'Func<Func<Object, void>, Object>' is not assignable to type 'Func<Func<string, void>, Object>'.
42
-
Types of parameters 'x' and 'x' are incompatible.
43
-
Types of parameters 'x' and 'x' are incompatible.
44
-
Type 'Object' is not assignable to type 'string'.
38
+
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
39
+
Type 'Object' is not assignable to type 'string'.
45
40
tests/cases/compiler/strictFunctionTypesErrors.ts(62,1): error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, Object>'.
46
-
Types of parameters 'x' and 'x' are incompatible.
47
-
Types of parameters 'x' and 'x' are incompatible.
48
-
Type 'Object' is not assignable to type 'string'.
41
+
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
49
42
tests/cases/compiler/strictFunctionTypesErrors.ts(65,1): error TS2322: Type 'Func<Func<Object, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
50
-
Types of parameters 'x' and 'x' are incompatible.
51
-
Types of parameters 'x' and 'x' are incompatible.
52
-
Type 'Object' is not assignable to type 'string'.
43
+
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
53
44
tests/cases/compiler/strictFunctionTypesErrors.ts(66,1): error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, string>'.
54
-
Types of parameters 'x' and 'x' are incompatible.
55
-
Types of parameters 'x' and 'x' are incompatible.
56
-
Type 'Object' is not assignable to type 'string'.
45
+
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
57
46
tests/cases/compiler/strictFunctionTypesErrors.ts(67,1): error TS2322: Type 'Func<Func<string, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
58
47
Type 'Object' is not assignable to type 'string'.
59
48
tests/cases/compiler/strictFunctionTypesErrors.ts(74,1): error TS2322: Type 'Func<Object, Func<string, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
60
49
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
61
-
Types of parameters 'x' and 'x' are incompatible.
62
-
Type 'Object' is not assignable to type 'string'.
63
50
tests/cases/compiler/strictFunctionTypesErrors.ts(75,1): error TS2322: Type 'Func<string, Func<Object, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
64
-
Types of parameters 'x' and 'x' are incompatible.
65
-
Type 'Object' is not assignable to type 'string'.
51
+
Type 'Object' is not assignable to type 'string'.
66
52
tests/cases/compiler/strictFunctionTypesErrors.ts(76,1): error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
67
-
Types of parameters 'x' and 'x' are incompatible.
68
-
Type 'Object' is not assignable to type 'string'.
53
+
Type 'Object' is not assignable to type 'string'.
69
54
tests/cases/compiler/strictFunctionTypesErrors.ts(79,1): error TS2322: Type 'Func<string, Func<Object, void>>' is not assignable to type 'Func<Object, Func<string, void>>'.
70
-
Types of parameters 'x' and 'x' are incompatible.
71
-
Type 'Object' is not assignable to type 'string'.
55
+
Type 'Object' is not assignable to type 'string'.
72
56
tests/cases/compiler/strictFunctionTypesErrors.ts(80,1): error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<Object, Func<string, void>>'.
73
-
Types of parameters 'x' and 'x' are incompatible.
74
-
Type 'Object' is not assignable to type 'string'.
57
+
Type 'Object' is not assignable to type 'string'.
75
58
tests/cases/compiler/strictFunctionTypesErrors.ts(83,1): error TS2322: Type 'Func<Object, Func<string, void>>' is not assignable to type 'Func<string, Func<Object, void>>'.
76
59
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
77
60
tests/cases/compiler/strictFunctionTypesErrors.ts(84,1): error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<string, Func<Object, void>>'.
78
61
Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
79
62
tests/cases/compiler/strictFunctionTypesErrors.ts(111,1): error TS2322: Type 'Comparer2<Dog>' is not assignable to type 'Comparer2<Animal>'.
80
63
Property 'dog' is missing in type 'Animal' but required in type 'Dog'.
81
64
tests/cases/compiler/strictFunctionTypesErrors.ts(126,1): error TS2322: Type 'Crate<Dog>' is not assignable to type 'Crate<Animal>'.
82
-
Types of property 'onSetItem' are incompatible.
83
-
Type '(item: Dog) => void' is not assignable to type '(item: Animal) => void'.
84
-
Types of parameters 'item' and 'item' are incompatible.
85
-
Type 'Animal' is not assignable to type 'Dog'.
65
+
Type 'Animal' is not assignable to type 'Dog'.
86
66
tests/cases/compiler/strictFunctionTypesErrors.ts(127,1): error TS2322: Type 'Crate<Animal>' is not assignable to type 'Crate<Dog>'.
87
-
Types of property 'item' are incompatible.
88
-
Type 'Animal' is not assignable to type 'Dog'.
67
+
Type 'Animal' is not assignable to type 'Dog'.
89
68
tests/cases/compiler/strictFunctionTypesErrors.ts(133,1): error TS2322: Type '(f: (x: Dog) => Dog) => void' is not assignable to type '(f: (x: Animal) => Animal) => void'.
90
69
Types of parameters 'f' and 'f' are incompatible.
91
70
Type 'Animal' is not assignable to type 'Dog'.
@@ -164,13 +143,11 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(c
164
143
g1 = g3; // Error
165
144
~~
166
145
!!! error TS2322: Type 'Func<string, Object>' is not assignable to type 'Func<Object, Object>'.
167
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
168
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
146
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
169
147
g1 = g4; // Error
170
148
~~
171
149
!!! error TS2322: Type 'Func<string, string>' is not assignable to type 'Func<Object, Object>'.
172
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
173
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
150
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
174
151
175
152
g2 = g1; // Error
176
153
~~
@@ -179,13 +156,11 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(c
179
156
g2 = g3; // Error
180
157
~~
181
158
!!! error TS2322: Type 'Func<string, Object>' is not assignable to type 'Func<Object, string>'.
182
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
183
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
159
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
184
160
g2 = g4; // Error
185
161
~~
186
162
!!! error TS2322: Type 'Func<string, string>' is not assignable to type 'Func<Object, string>'.
187
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
188
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
163
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
189
164
190
165
g3 = g1; // Ok
191
166
g3 = g2; // Ok
@@ -223,29 +198,22 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(c
223
198
h3 = h1; // Error
224
199
~~
225
200
!!! error TS2322: Type 'Func<Func<Object, void>, Object>' is not assignable to type 'Func<Func<string, void>, Object>'.
226
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
227
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
228
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
201
+
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
202
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
229
203
h3 = h2; // Error
230
204
~~
231
205
!!! error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, Object>'.
232
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
233
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
234
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
206
+
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
235
207
h3 = h4; // Ok
236
208
237
209
h4 = h1; // Error
238
210
~~
239
211
!!! error TS2322: Type 'Func<Func<Object, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
240
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
241
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
242
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
212
+
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
243
213
h4 = h2; // Error
244
214
~~
245
215
!!! error TS2322: Type 'Func<Func<Object, void>, string>' is not assignable to type 'Func<Func<string, void>, string>'.
246
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
247
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
248
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
216
+
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
249
217
h4 = h3; // Error
250
218
~~
251
219
!!! error TS2322: Type 'Func<Func<string, void>, Object>' is not assignable to type 'Func<Func<string, void>, string>'.
@@ -260,30 +228,24 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(c
260
228
~~
261
229
!!! error TS2322: Type 'Func<Object, Func<string, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
262
230
!!! error TS2322: Type 'Func<string, void>' is not assignable to type 'Func<Object, void>'.
263
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
264
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
265
231
i1 = i3; // Error
266
232
~~
267
233
!!! error TS2322: Type 'Func<string, Func<Object, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
268
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
269
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
234
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
270
235
i1 = i4; // Error
271
236
~~
272
237
!!! error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<Object, Func<Object, void>>'.
273
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
274
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
238
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
275
239
276
240
i2 = i1; // Ok
277
241
i2 = i3; // Error
278
242
~~
279
243
!!! error TS2322: Type 'Func<string, Func<Object, void>>' is not assignable to type 'Func<Object, Func<string, void>>'.
280
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
281
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
244
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
282
245
i2 = i4; // Error
283
246
~~
284
247
!!! error TS2322: Type 'Func<string, Func<string, void>>' is not assignable to type 'Func<Object, Func<string, void>>'.
285
-
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
286
-
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
248
+
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
287
249
288
250
i3 = i1; // Ok
289
251
i3 = i2; // Error
@@ -342,15 +304,11 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(c
342
304
animalCrate = dogCrate; // Error
343
305
~~~~~~~~~~~
344
306
!!! error TS2322: Type 'Crate<Dog>' is not assignable to type 'Crate<Animal>'.
345
-
!!! error TS2322: Types of property 'onSetItem' are incompatible.
346
-
!!! error TS2322: Type '(item: Dog) => void' is not assignable to type '(item: Animal) => void'.
347
-
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
348
-
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
307
+
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
349
308
dogCrate = animalCrate; // Error
350
309
~~~~~~~~
351
310
!!! error TS2322: Type 'Crate<Animal>' is not assignable to type 'Crate<Dog>'.
352
-
!!! error TS2322: Types of property 'item' are incompatible.
353
-
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
311
+
!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'.
354
312
355
313
// Verify that callback parameters are strictly checked
0 commit comments