Skip to content

Infer array rest as tuple if possible - #26070

Merged
Ryan Cavanaugh (RyanCavanaugh) merged 4 commits into
microsoft:masterfrom
ajafff:tuple-rest
Oct 1, 2018
Merged

Infer array rest as tuple if possible#26070
Ryan Cavanaugh (RyanCavanaugh) merged 4 commits into
microsoft:masterfrom
ajafff:tuple-rest

Conversation

@ajafff

@ajafff Klaus Meinhardt (ajafff) commented Jul 30, 2018

Copy link
Copy Markdown
Contributor

Fixes: #26007

I hope this helps to decide if you want to accept #26007 as you can now see what baseline changes it causes.

var a3: any[];
var [...a] = [1, 2, 3];
var [x, ...a] = [1, 2, 3];
~

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd change the variable names at these new errors in this test so that you're comparing with the expected type and there's no error.

@weswigham Wesley Wigham (weswigham) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

❤️ These baseline updates look great. Small comments on improving the test output a bit, but it looks good to me.

@RyanCavanaugh

Copy link
Copy Markdown
Member

Will run this by Anders Hejlsberg (@ahejlsberg) tomorrow but I agree the baseline diffs indicate all goodness

@RyanCavanaugh

Copy link
Copy Markdown
Member

"tomorrow"

@RyanCavanaugh

Copy link
Copy Markdown
Member

Thanks Klaus Meinhardt (@ajafff) !

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants