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
typeRestParams=[y: string]|[y: number];typeSignature=(x: string, ...rest: RestParams)=>void;typeMergedParams=Parameters<Signature>;// never
π Actual behavior
MergedParams is of type never.
π Expected behavior
MergedParams is of type [x: string, y: string] | [x: string, y: number]
I realise this can sort of be done by using [y: string | number] as type for RestParams. However, I'm using unions in parameters like this in order to overload the signatures of functions in jsdoc as shown here: #25590 (comment)
If I use a union like that it will show up as union in VSCode, instead of using the multiple signatures UI.
Here's an example of this: Playground link.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
merged parameters rest union never
π Version & Regression Information
union
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
MergedParams
is of typenever
.π Expected behavior
MergedParams
is of type[x: string, y: string] | [x: string, y: number]
I realise this can sort of be done by using
[y: string | number]
as type forRestParams
. However, I'm using unions in parameters like this in order to overload the signatures of functions in jsdoc as shown here: #25590 (comment)If I use a union like that it will show up as union in VSCode, instead of using the multiple signatures UI.
Here's an example of this: Playground link.
The text was updated successfully, but these errors were encountered: