loosing promise type when using await
See original GitHub issueasync function foo() {
let /** null */ x = await Promise.resolve(1); // no type warning
Promise.resolve(1).then((value) => {x = value}); // type warning
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
lost promise in async await method - node.js - Stack Overflow
You are mixing two "styles" the callback approach in the "exec" function and you are trying to await that bumpDiff that is not...
Read more >Understand promises before you start using async/await
However, what a lot of people may have missed is that the entire foundation for async/await is promises. In fact every async function...
Read more >Error handling with Async/Await in JS | by Ian Segers | ITNEXT
Now we have the classic problem, thisThrows returns a rejecting promise, so the regular try...catch is not able to catch the error. As...
Read more >From JavaScript Promises to Async/Await: why bother?
The purpose of async/await functions is to simplify the behavior of using Promises synchronously and to perform some behavior on a group of ......
Read more >Async Await in Node.js - How to Master it? - Blog - RisingStack
Learn how to use async await in Node.js (async functions) to simplify your callback or Promise based application.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Current status of the work I mentioned is that we’re close to having ES6 class transpilation happen after type checking. Most of what’s left is fixing Google internal code containing type-related errors previously hidden by the transpilation.
After that the next blocker is moving destructuring transpilation. @lauraharker has been very active in making the changes needed to make that happen.
After that moving async function transpilation will be relatively easy, possibly a single commit, because theoretically all the work needed other than moving the other transpilations it depends on is already done.
I expect it all to be done by the end of this quarter.
We’re actively working to improve type checking for async functions this quarter. I expect this to get fixed as part of that work.