🔎 Search Terms
await promise void "'await' has no effect on the type of this expression" function return type parameter
🕗 Version & Regression Information
- This changed between versions 3.6.3 and 3.7.5
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.5.0-dev.20240507#code/MYewdgzgLgBAJiAyiAtgUygCwJZgOYwC8MAhhAJ5jAwAUwJANgwEYnADWAXLQJREB8MAG4hscPoUEBvAFAxSAdxLZY9Jqw40eMgL4yZCZOiy48NMpWpaBMWfID09mADpXunkA
💻 Code
const doSomething = async (callback: () => void) => {
await callback()
}
doSomething(async () => {
// ...
})
🙁 Actual behavior
There is a warning at the "await" saying
'await' has no effect on the type of this expression.(80007)
But the return type might be a promise.
🙂 Expected behavior
No warning
Additional information about the issue
No response
🔎 Search Terms
await promise void "'await' has no effect on the type of this expression" function return type parameter
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.5.0-dev.20240507#code/MYewdgzgLgBAJiAyiAtgUygCwJZgOYwC8MAhhAJ5jAwAUwJANgwEYnADWAXLQJREB8MAG4hscPoUEBvAFAxSAdxLZY9Jqw40eMgL4yZCZOiy48NMpWpaBMWfID09mADpXunkA
💻 Code
🙁 Actual behavior
There is a warning at the "await" saying
But the return type might be a promise.
🙂 Expected behavior
No warning
Additional information about the issue
No response