1
+ tests/cases/compiler/destructuringTuple.ts(11,7): error TS2461: Type 'number' is not an array type.
2
+ tests/cases/compiler/destructuringTuple.ts(11,48): error TS2769: No overload matches this call.
3
+ Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error.
4
+ Type 'never[]' is not assignable to type 'number'.
5
+ Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error.
6
+ Type 'never[]' is not assignable to type '[]'.
7
+ Target allows only 0 element(s) but source may have more.
1
8
tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload matches this call.
2
9
Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
3
10
Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
4
11
Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
5
12
Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
6
13
7
14
8
- ==== tests/cases/compiler/destructuringTuple.ts (1 errors) ====
15
+ ==== tests/cases/compiler/destructuringTuple.ts (3 errors) ====
9
16
declare var tuple: [boolean, number, ...string[]];
10
17
11
18
const [a, b, c, ...rest] = tuple;
@@ -17,6 +24,17 @@ tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload mat
17
24
// Repros from #32140
18
25
19
26
const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []);
27
+ ~~~~~~~
28
+ !!! error TS2461: Type 'number' is not an array type.
29
+ ~~~~~~~~~~~~~~~
30
+ !!! error TS2769: No overload matches this call.
31
+ !!! error TS2769: Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error.
32
+ !!! error TS2769: Type 'never[]' is not assignable to type 'number'.
33
+ !!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error.
34
+ !!! error TS2769: Type 'never[]' is not assignable to type '[]'.
35
+ !!! error TS2769: Target allows only 0 element(s) but source may have more.
36
+ !!! related TS6502 /.ts/lib.es5.d.ts:1429:24: The expected type comes from the return type of this signature.
37
+ !!! related TS6502 /.ts/lib.es5.d.ts:1435:27: The expected type comes from the return type of this signature.
20
38
~~
21
39
!!! error TS2769: No overload matches this call.
22
40
!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
0 commit comments