Promise.resolve
fails to infer the correct type when the argument is a union type like T | Promise<T> | PromiseLike<T>
#48195
Labels
Milestone
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The variable
g3
fails the type check with the following errorHere,
g3
is infered to the typePromise<number | Promise<number>>
. However, comparing to the behavior ong1
andg2
, this seems to be a bug, which should bePromise<number>
instead.π Expected behavior
No error.
The text was updated successfully, but these errors were encountered: