-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
A second argument in Promise.all([...]) that returns a Record breaks the return signature #34924
Comments
But the playground you linked to types |
Sorry, you're right. It's that the first argument coming back from |
I see. Once the example is corrected, this appears to work as you'd like it to in 3.6.3, but not 3.7.2 |
Maybe fixed by #33707 |
This will be fixed by #33707 |
Actually, this is a specific reproduction of #34937. This one came first by some number of minutes or hours, but the other has more discussion, so I’m going to mark this one duplicate—nothing personal @dannycochran 😄 |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
TypeScript Version:
3.7.2
Search Terms:
Promise.all, Record
Code
Expected behavior:
The first variable in the deconstructed array should be correctly typed as
MoviesResponse
, rather thanCharactersResponse
. This worked in 3.6.4.Actual behavior:
Both variables in the deconstructed array are inferred to be
CharactersResponse
. So when I try to deconstruct the first argument doing{ movies }
, it's an invalid destructuring.Interestingly, if we update
CharactersResponse
to not be a map type, the problem goes away, e.g:Playground Link:
http://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=17&pc=6#code/JYOwLgpgTgZghgYwgAgLIHsBuwIGcBKeADuiLigN4BQytyAtljrgFzIDaAugNxUC+VKmACeRFAGEAFnCiJIUAsVLlkAXmSEE6KABMAPCACu9AEbQANMjghhAPl5UtZMMgDmEMBmx41V3MJAEZAAKAEo2AAUodHpgcj0vZkJcEjIIWzUM4Oo6BiY8Ni5zflDBJ1wXdzApGTloXF84f0CQ8OQomLiIPRrZBHlFFOV0zJDqPlCHYKaAoLDRnLpyl3YKPO8GvksEaT6BzkaAdzhgFw7Y8gA6OAAbG+D2KsS8MMsq3rqFMM5JmiXldA3CCXG7oVzBRgbba7T64X4TMLcIA
Related Issues:
None found.
The text was updated successfully, but these errors were encountered: