You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
Return type of f is invalid because the correct type is Promise<awaited T>.
Return types of g are Promise<awaited T> and Promise<number>. Actual behavior:
Return type of f is valid although the correct type is Promise<awaited T>.
Return types of g are Promise<T> and Promise<Promise<number>>.
The text was updated successfully, but these errors were encountered:
falsandtru
changed the title
awaited operator is not added to return types of async functions
awaited operator is not added to the return types of async functions
Mar 25, 2020
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms:
Code
Expected behavior:
Return type of f is invalid because the correct type is
Promise<awaited T>
.Return types of g are
Promise<awaited T>
andPromise<number>
.Actual behavior:
Return type of f is valid although the correct type is
Promise<awaited T>
.Return types of g are
Promise<T>
andPromise<Promise<number>>
.Playground Link: https://www.typescriptlang.org/play/index.html?ts=3.9.0-dev.20200324&ssl=1&ssc=1&pln=7&pc=23#code/IYZwngdgxgBAZgV2gFwJYHsLwDwBUB8AFMAFwy4CUZACgE7oC2qIApnvjAN4BQMfMtFsgS0swANzcAvt1CRYiFBiwBzdsTKUuvfoOGiYE6dxWE6jZiwB0gkOgA2ANxaEADBQrigA
Related Issues:
The text was updated successfully, but these errors were encountered: