-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Error when use spread arguments twice #32835
Comments
@elibarzilay I think your tuple PR recently fixed this bug. Can you confirm? |
#33069 is fixing one aspect of this issue, but there is an additional issue with typechecking the arguments. An example of this:
fails with
which is bogus due to code that does not handle spreaded tuples properly. (A fix for that is probably in the loop which is around the middle of |
elibarzilay
added a commit
to elibarzilay/TypeScript
that referenced
this issue
May 27, 2020
This completes the work that started in PR microsoft#33069, and fixes microsoft#32835. There are probably two additional related changes that are needed to make this more complete: * Fix the code that composes the error message (see the first two `FIXME`s in `callWithSpread3.ts`). * Fix the code that checks the argument types (second two `FIXME`s). * There is also an error in `genericRestParameters1.ts` which changed but should not be an error in the first place. Added a `FIXME` there too. (Probably will work if the previous iterm is done.) In addition, `getEffectiveCallArguments` munges the arguments in case of a spread in the last argument which might be better to avoid. (I think that there are cases where it wouldn't work anyway, such as a spread of an array followed by a spread of an empty array.)
elibarzilay
added a commit
to elibarzilay/TypeScript
that referenced
this issue
May 27, 2020
This completes the work that started in PR microsoft#33069, and fixes microsoft#32835. There are probably two additional related changes that are needed to make this more complete: * Fix the code that composes the error message (see the first two `FIXME`s in `callWithSpread3.ts`). * Fix the code that checks the argument types (second two `FIXME`s). * There is also an error in `genericRestParameters1.ts` which changed but should not be an error in the first place. Added a `FIXME` there too. (Probably will work if the previous iterm is done.) In addition, `getEffectiveCallArguments` munges the arguments in case of a spread in the last argument which might be better to avoid. (I think that there are cases where it wouldn't work anyway, such as a spread of an array followed by a spread of an empty array.)
elibarzilay
added a commit
that referenced
this issue
Jun 5, 2020
This completes the work that started in PR #33069, and fixes #32835. There are probably two additional related changes that are needed to make this more complete: * Fix the code that composes the error message (see the first two `FIXME`s in `callWithSpread3.ts`). * Fix the code that checks the argument types (second two `FIXME`s). * There is also an error in `genericRestParameters1.ts` which changed but should not be an error in the first place. Added a `FIXME` there too. (Probably will work if the previous iterm is done.) In addition, `getEffectiveCallArguments` munges the arguments in case of a spread in the last argument which might be better to avoid. (I think that there are cases where it wouldn't work anyway, such as a spread of an array followed by a spread of an empty array.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TypeScript Version: 3.5.1
Search Terms:
Code
Expected behavior:
No errors
Actual behavior:
Playground Link: link
Related Issues:
The text was updated successfully, but these errors were encountered: