Skip to content

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

@DanielRosenwasser

Description

@DanielRosenwasser

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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Signature HelpInformation in editor tooltips when invoking a function callFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions