Closed
Description
TypeScript Version: 3.8.2, nightly
Search Terms:
Function truthiness, function truthy check
Code
const someBool = true;
function f() {}
if (f) {}
if (someBool && f) {}
if (!someBool || f) {}
Expected behavior:
All three if
statements should throw a This condition will always return true since the function is always defined. Did you mean to call it instead?
error.
Actual behavior:
Only the first statement throws the error.
Related Issues:
#37149