-
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
consider spread tuples when matching signature #18004
consider spread tuples when matching signature #18004
Conversation
Fixes the third part of microsoft#5453, needed to effectively type `bind` (Function.prototype), `curry` and `compose`. Depends on microsoft#17961 type calls, microsoft#17884 type spread and microsoft#18004 tuple spread. The first 2/3 are included, so changes will look more cluttered here though new changes just span 10 lines over 2 functions. Will properly test this when those are ready -- now still broken.
This is really awesome. I think all these error message changes make them more informative. |
Thanks! 😃 |
please merge this! |
I'm stuck without this! |
should all those tests have been committed? |
@eknowles: yeah, that was intended; if I hadn't committed the test changes, CI would have errored out on unexpected changes. fortunately the changes themselves seem positive. |
I think we should actually update I poked at this last month but found it was non-trivial. I'm going to try again and see if I can get a limited version working at least. |
@sandersn: thank you for your take on this, I much appreciate it. Although over here I hadn't directly bumped into issues yet, I'd tried this route in my shot at type calls (6606) as well, where the consequences of AST manipulation became all too evident. I may definitely have been naive in my approach, and I'd be interested to see what a proper approach would end up looking like here. But yeah, I'll take your word for it it wouldn't be trivial... |
@tycho01 I put a prototype up at the branch [1] Specifically, overloads and functions with type parameters. |
@sandersn: thanks, I just checked it too. It does look tough having to handle several cases separately rather than being able to just hook into existing logic. To throw this out there, had the idea of using synthetic nodes been discussed before? I won't deny it feels hacky, though it also helped simplify a few things. For reference, pain points I experienced with the approach, particularly in #17961, revolved around error reporting / matching nodes as used in the tooltip messages. I'd definitely only managed to address part of the issues there, but then again, my knowledge about the compiler is still kinda limited anyway. |
Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it. |
Fixes #4130.
Edit: fixed error on other test. Looks like test results improved there as well.