We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Promise<void>
void
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
promise void
4.5.0-dev.20211021
Playground link with relevant code
declare const foo: (fn: () => Promise<void>) => void //error: Type 'Promise<number>' is not assignable to type 'Promise<void>'. foo(async () => 1)
error: Type 'Promise<number>' is not assignable to type 'Promise<void>'.
a function that returns a Promise for a non-null value should be assignable to a function that returns Promise<void> because that's the purpose of void. see https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-functions-returning-non-void-assignable-to-function-returning-void
Promise
The text was updated successfully, but these errors were encountered:
Duplicate of #44201 / #12871. Used search terms: promise void in:title
promise void in:title
Sorry, something went wrong.
No branches or pull requests
Bug Report
π Search Terms
promise void
π Version & Regression Information
4.5.0-dev.20211021
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
π Expected behavior
a function that returns a
Promise
for a non-null value should be assignable to a function that returnsPromise<void>
because that's the purpose ofvoid
. see https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-functions-returning-non-void-assignable-to-function-returning-voidThe text was updated successfully, but these errors were encountered: