Skip to content

Improve inference for Promise.all of 'never[]' - #39336

Closed
Ron Buckton (rbuckton) wants to merge 2 commits into
mainfrom
fix37856
Closed

Improve inference for Promise.all of 'never[]'#39336
Ron Buckton (rbuckton) wants to merge 2 commits into
mainfrom
fix37856

Conversation

@rbuckton

Copy link
Copy Markdown
Contributor

This adds overloads to Promise.all to improve treat a Promise.all for an array of type never[] as a Promise<never> rather than a Promise<never[]>.

Fixes #37856

@andrewbranch

Copy link
Copy Markdown
Member

Makes sense to me, but should we run user tests?

TypeScript Bot (@typescript-bot) user test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 30, 2020

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I've started to run the parallelized community code test suite on this PR at eb27d3e. You can monitor the build here.

@typescript-bot

Copy link
Copy Markdown
Contributor

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@rbuckton

Copy link
Copy Markdown
Contributor Author

Yeah, looking at this a little bit more, there really isn't a way to craft the overload list to get the correct result here.

@rbuckton

Copy link
Copy Markdown
Contributor Author

Actually, I may have found a solution. I'll try that first before giving up on this line of thought...

@rbuckton

Copy link
Copy Markdown
Contributor Author
@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 1, 2020

Copy link
Copy Markdown
Contributor

Heya Ron Buckton (@rbuckton), I've started to run the parallelized community code test suite on this PR at b486b5e. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 1, 2020

Copy link
Copy Markdown
Contributor

Heya Ron Buckton (@rbuckton), I've started to run the extended test suite on this PR at b486b5e. You can monitor the build here.

@rbuckton

Ron Buckton (rbuckton) commented Jul 2, 2020

Copy link
Copy Markdown
Contributor Author

Even this doesn't work because it collides with Promise.all<T> in vscode for cases like Promise.all<string[]>(...) when the intended return type is Promise<string[][]>.

For reference:
https://github.com/typescript-bot/TypeScript/pull/54/files#diff-0e62d568d28b82cee9e66b2b8fafd290R7

@rbuckton
Ron Buckton (rbuckton) marked this pull request as draft July 2, 2020 00:10
@rbuckton

Copy link
Copy Markdown
Contributor Author

I'm switching this to a draft PR for the time being while I consider other alternatives.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

4 participants