Skip to content
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

Fix out-of-bounds issue in getParameterNameAtPosition #30179

Merged
merged 3 commits into from
Mar 2, 2019

Conversation

ahejlsberg
Copy link
Member

Fixes #30171.

@@ -21641,7 +21641,7 @@ namespace ts {
if (isTupleType(restType)) {
const associatedNames = (<TupleType>(<TypeReference>restType).target).associatedNames;
const index = pos - paramCount;
return associatedNames ? associatedNames[index] : restParameter.escapedName + "_" + index as __String;
return associatedNames && associatedNames[index] || restParameter.escapedName + "_" + index as __String;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cute fix 😄

@ahejlsberg ahejlsberg merged commit 8794ebd into master Mar 2, 2019
@ahejlsberg ahejlsberg deleted the fixGetParameterNameAtPosition2 branch March 2, 2019 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants