-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Improve inference for a tuple target with 2 middle variadic elements and implied arity for the latter #56976
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
base: main
Are you sure you want to change the base?
Improve inference for a tuple target with 2 middle variadic elements and implied arity for the latter #56976
Conversation
…and implied arity for the latter
| inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); | ||
| inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]); | ||
| } | ||
| else if ((targetInfo = getInferenceInfoForType(elementTypes[startLength + 1]))?.impliedArity !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: I might have to limit this to fixed-sized sources or something. This requires more test cases to exercise the improved behavior. It would help me slightly if I'd have a playground with this build - @jakebailey would you mind creating one? :)
…ariadic-elements # Conflicts: # tests/baselines/reference/variadicTuples3.symbols # tests/baselines/reference/variadicTuples3.types # tests/cases/conformance/types/tuple/variadicTuples3.ts
|
@typescript-bot pack this |
|
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
fixes #56970