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

Non-end rest parameters support types #1648

Merged
merged 8 commits into from
Dec 18, 2024
Merged

Non-end rest parameters support types #1648

merged 8 commits into from
Dec 18, 2024

Conversation

edemaine
Copy link
Collaborator

Fixes #929 by

  • Typing new end rest parameter as tuple type
  • Add type casting of splice return value
  • Add ref to type cast remaining array, but only for TypeScript output

Lots of other internal cleanup along the way:

  • Fix traversal functions to allow non-Predicate arguments instead of erroring. In this case, they just don't filter.
  • Move NonEmptyParameters handler into processParams
  • Uniform use of PostRestBindingElements in blockPrefix
  • Parameters node now has parameters property with array of actual parameters
  • Internal type fixes

Copy link
Contributor

@STRd6 STRd6 left a comment

Choose a reason for hiding this comment

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

Thanks, great improvement! I’m glad the TS types ended up being so simple.

@edemaine edemaine merged commit bb241bb into main Dec 18, 2024
4 checks passed
@edemaine edemaine deleted the rest branch December 18, 2024 20:32
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.

Rest elements at middle/end position and types
2 participants