mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
39 lines
2.0 KiB
Plaintext
39 lines
2.0 KiB
Plaintext
destructuringTuple.ts(11,7): error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator.
|
|
destructuringTuple.ts(11,48): error TS2769: No overload matches this call.
|
|
The last overload gave the following error.
|
|
Type 'never[]' is not assignable to type '[]'.
|
|
Target allows only 0 element(s) but source may have more.
|
|
destructuringTuple.ts(11,60): error TS2769: No overload matches this call.
|
|
The last overload gave the following error.
|
|
Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
|
|
|
|
|
|
==== destructuringTuple.ts (3 errors) ====
|
|
declare var tuple: [boolean, number, ...string[]];
|
|
|
|
const [a, b, c, ...rest] = tuple;
|
|
|
|
declare var receiver: typeof tuple;
|
|
|
|
[...receiver] = tuple;
|
|
|
|
// Repros from #32140
|
|
|
|
const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []);
|
|
~~~~~~~
|
|
!!! error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator.
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type 'never[]' is not assignable to type '[]'.
|
|
!!! error TS2769: Target allows only 0 element(s) but source may have more.
|
|
!!! related TS6502 lib.es5.d.ts:--:--: The expected type comes from the return type of this signature.
|
|
!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here.
|
|
~~
|
|
!!! error TS2769: No overload matches this call.
|
|
!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
|
|
!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here.
|
|
|
|
const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []);
|
|
|