Skip to content

Signature help argument index is wrong with tuple union rest parameter #39228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DanielRosenwasser opened this issue Jun 24, 2020 · 0 comments · Fixed by #39317
Closed

Signature help argument index is wrong with tuple union rest parameter #39228

DanielRosenwasser opened this issue Jun 24, 2020 · 0 comments · Fixed by #39317
Assignees
Labels
Bug A bug in TypeScript Domain: Signature Help Information in editor tooltips when invoking a function call Fix Available A PR has been opened for this issue

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jun 24, 2020

image

function foo(...args: [string, string] | [number, string, string]
) {
    
}

foo(123/**/,)

Expected: first parameter is considered the current parameter
Actual: second parameter is always the current parameter

https://www.typescriptlang.org/v2/play?ts=4.0.0-dev.20200623#code/PQKhFgCgAIWgBALgTwA4FNoG8AUA6AgQwCcBzAZwC5oBtcxYgSwDtSAaaep1gXWgB9azAK4BbAEbpiHLi3acGcngEpoAXgB80AG4B7RgBMAvlFjAoAM2HMAxoka7m0C7t34iZKrVmsZi3gJCYpLSCtzyPqQ8UKpYptAJUCaQlq44AIwATADMbMpAA

@DanielRosenwasser DanielRosenwasser changed the title Signature help parameter index is wrong with tuple union rest parameter Signature help argument index is wrong with tuple union rest parameter Jun 24, 2020
@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: Signature Help Information in editor tooltips when invoking a function call labels Jun 24, 2020
@DanielRosenwasser DanielRosenwasser added this to the Typescript 4.0.1 milestone Jun 24, 2020
weswigham added a commit to weswigham/TypeScript that referenced this issue Jun 29, 2020
@weswigham weswigham added the Fix Available A PR has been opened for this issue label Jun 29, 2020
weswigham added a commit that referenced this issue Jun 29, 2020
* Use mapped rest type member when expanding rest parameter names

* Add test for #39228 which is also fixed by parameters having unique names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Signature Help Information in editor tooltips when invoking a function call Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants