Closed
Description
TypeScript Version: 3.0.0-dev.20180626
Search Terms:
- await
- conditional
- diagnostics
Code
async function foo(): Promise<boolean> {
return false;
}
async function bar(): Promise<string> {
if (foo()) {
return 'true';
}
return 'false';
}
Expected behavior:
A warning or error or suggestion is generated in the if
conditional since it will always be true. The user almost certainly intended to await the result of foo
instead.
Possibly also have a quick fix to add the await
Actual behavior:
No errors or warnings. Code does unexpected things