@@ -1211,22 +1211,94 @@ References:
1211
1211
^ [2]
1212
1212
1213
1213
1214
- Error --------------------------------------------------------------------------------------------------- spread.js:90:1
1214
+ Error --------------------------------------------------------------------------------------------------- spread.js:92:8
1215
1215
1216
- Cannot call `f` because `T` [1] is underconstrained by call of `f` [2]. Either add explicit type arguments or cast the
1217
- expression to your expected type. [underconstrained-implicit-instantiation]
1216
+ Cannot declare `TupleArrSpread` [1] because the name is already bound. [name-already-bound]
1218
1217
1219
- spread.js:90:1
1220
- 90| f([1, 2, 3]) ; // ERROR: annotation required - reversal not yet implemented
1221
- ^
1218
+ spread.js:92:8
1219
+ 92| type TupleArrSpread = [0, ...typeof x] ; // OK
1220
+ ^^^^^^^^^^^^^ ^
1222
1221
1223
1222
References:
1224
- spread.js:89:20
1225
- 89| declare function f<T>(xs: [1, ...T]): void;
1226
- ^ [1]
1227
- spread.js:90:1
1228
- 90| f([1, 2, 3]); // ERROR: annotation required - reversal not yet implemented
1229
- ^^^^^^^^^^^^ [2]
1223
+ spread.js:80:8
1224
+ 80| type TupleArrSpread = [0, ...typeof x]; // OK
1225
+ ^^^^^^^^^^^^^^ [1]
1226
+
1227
+
1228
+ Error -------------------------------------------------------------------------------------------------- spread.js:105:3
1229
+
1230
+ Cannot cast `x` to tuple type because `T` [1] has 2 elements but tuple type [2] has 3 elements. [invalid-tuple-arity]
1231
+
1232
+ spread.js:105:3
1233
+ 105| x as [1, 2, 3]; // ERROR
1234
+ ^
1235
+
1236
+ References:
1237
+ spread.js:96:37
1238
+ 96| declare function tail<T>(xs: [1, ...T]): T;
1239
+ ^ [1]
1240
+ spread.js:105:8
1241
+ 105| x as [1, 2, 3]; // ERROR
1242
+ ^^^^^^^^^ [2]
1243
+
1244
+
1245
+ Error -------------------------------------------------------------------------------------------------- spread.js:107:7
1246
+
1247
+ Cannot call `tail` with array literal bound to `xs` because number [1] is incompatible with number literal `1` [2] in
1248
+ index 0. [incompatible-call]
1249
+
1250
+ spread.js:107:7
1251
+ 107| tail([666, 2, 3]); // ERROR
1252
+ ^^^ [1]
1253
+
1254
+ References:
1255
+ spread.js:96:31
1256
+ 96| declare function tail<T>(xs: [1, ...T]): T;
1257
+ ^ [2]
1258
+
1259
+
1260
+ Error -------------------------------------------------------------------------------------------------- spread.js:108:6
1261
+
1262
+ Cannot determine type of empty array literal. Please provide an annotation. [missing-empty-array-annot]
1263
+
1264
+ 108| tail([]); // ERROR
1265
+ ^^
1266
+
1267
+
1268
+ Error -------------------------------------------------------------------------------------------------- spread.js:111:1
1269
+
1270
+ Cannot call `noReversal1` because `T` [1] is underconstrained by call of `noReversal1` [2]. Either add explicit type
1271
+ arguments or cast the expression to your expected type. [underconstrained-implicit-instantiation]
1272
+
1273
+ spread.js:111:1
1274
+ 111| noReversal1([1, 9, 2]); // ERROR
1275
+ ^^^^^^^^^^^
1276
+
1277
+ References:
1278
+ spread.js:110:30
1279
+ 110| declare function noReversal1<T>(xs: [1, ...T, 2]): T;
1280
+ ^ [1]
1281
+ spread.js:111:1
1282
+ 111| noReversal1([1, 9, 2]); // ERROR
1283
+ ^^^^^^^^^^^^^^^^^^^^^^ [2]
1284
+
1285
+
1286
+ Error -------------------------------------------------------------------------------------------------- spread.js:114:1
1287
+
1288
+ Cannot call `noReversal2` because `T` [1] is underconstrained by call of `noReversal2` [2]. Either add explicit type
1289
+ arguments or cast the expression to your expected type. [underconstrained-implicit-instantiation]
1290
+
1291
+ spread.js:114:1
1292
+ 114| noReversal2([1, 2, 3]); // ERROR
1293
+ ^^^^^^^^^^^
1294
+
1295
+ References:
1296
+ spread.js:113:30
1297
+ 113| declare function noReversal2<T>(xs: [...T, ...any]): T;
1298
+ ^ [1]
1299
+ spread.js:114:1
1300
+ 114| noReversal2([1, 2, 3]); // ERROR
1301
+ ^^^^^^^^^^^^^^^^^^^^^^ [2]
1230
1302
1231
1303
1232
1304
Error --------------------------------------------------------------------------------------------------- too-few.js:5:5
@@ -1998,4 +2070,4 @@ References:
1998
2070
1999
2071
2000
2072
2001
- Found 125 errors
2073
+ Found 130 errors
0 commit comments