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
{{ message }}
Repository navigation
Promise.resolve fails to infer the correct type when the argument is a union type like T | Promise<T> | PromiseLike<T>Β #48195
The variable g3 fails the type check with the following error
Type 'Promise<number | Promise<number>>' is not assignable to type 'Promise<number>'.
Type 'number | Promise<number>' is not assignable to type 'number'.
Type 'Promise<number>' is not assignable to type 'number'.
Here, g3 is infered to the type Promise<number | Promise<number>>. However, comparing to the behavior on g1 and g2, this seems to be a bug, which should be Promise<number> instead.
Activity
weswigham commentedon Mar 10, 2022
#37615