akibo
akibo

Reputation: 715

typescript concat warning no overloading match

console.log([].concat(0, 123))

I've no clue what the error means

No overload matches this call.
  Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type '0' is not assignable to parameter of type 'ConcatArray<never>'.
  Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type '0' is not assignable to parameter of type 'ConcatArray<never>'.ts(2769)

I assign to a variable and declare any type I still see the error.

Upvotes: 2

Views: 1597

Answers (1)

DevLoverUmar
DevLoverUmar

Reputation: 13933

Try this:

console.log(([] as any[]).concat(0, 123));

For more info, check this github issue

Upvotes: 1

Related Questions