-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
TupleGenerator #59627
base: main
Are you sure you want to change the base?
TupleGenerator #59627
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@zojize please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
TupleGenerator
This is an experiment attempting to add support to #42033 using the syntax @thehappycheese brought up. It adds a new type:
When a custom iterable or builtin generator is spread explicitly using this type in a call expression or array literal, it should infer the correct arity and types instead of reporting an error.
Example
Limitations
Alternatives
just make atoTuple(): [number, number]
function*[]
a dedicated syntax for generator tuples with a leading*
, needs change to parserCan someone help pack this to playground 😃?