Skip to content

Simplify tuple destructuring logic #32178

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

Merged
merged 9 commits into from
Jul 3, 2019
Merged

Conversation

ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented Jun 29, 2019

This PR removes the general logic we had for padding array literals that are contextually typed by tuple types and isolates it to the one case where it is needed: parameter array binding elements with tuple type initializers of lesser arity than the array binding elements. It fixes the incorrect error that was reported in #32140 and picks up the better error messages that are reported by getIndexedAccessType.

Fixes #32140.

@ahejlsberg ahejlsberg added this to the TypeScript 3.6.0 milestone Jun 29, 2019
@ahejlsberg ahejlsberg requested a review from RyanCavanaugh June 29, 2019 03:21
@ahejlsberg
Copy link
Member Author

@typescript-bot run dt
@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 29, 2019

Heya @ahejlsberg, I've started to run the extended test suite on this PR at 4c99084. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 29, 2019

Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 4c99084. You can monitor the build here. It should now contribute to this PR's status checks.

@ahejlsberg
Copy link
Member Author

@typescript-bot run dt
@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 30, 2019

Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 17153a6. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 30, 2019

Heya @ahejlsberg, I've started to run the extended test suite on this PR at 17153a6. You can monitor the build here. It should now contribute to this PR's status checks.

@ahejlsberg
Copy link
Member Author

DT and RWC test runs are clean (RWC difference is unrelated to this PR).

@ahejlsberg ahejlsberg merged commit 340f810 into master Jul 3, 2019
@ahejlsberg ahejlsberg deleted the improveTupleDestructuring branch July 3, 2019 00:25
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.

Contextual type from destructuring binding for Array#reduce produces bad errors
3 participants