Bug Report
🔎 Search Terms
uncalled function checks, negation
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
Playground link with relevant code
💻 Code
declare function isFoo(): boolean;
declare const isUndefinedFoo: (() => boolean) | undefined;
if (isFoo) {
// uncalled function checks already work well here
}
if (!isFoo) {
// uncalled function checks should cover this case too
}
if (!isUndefinedFoo) {
// this case should not be covered
}
🙁 Actual behavior
Uncalled function checks do not work with the ! operator.
🙂 Expected behavior
Unless a function may be undefined it would be very helpful to check whether it is called when it is used with the ! operator.
I created this issue to separate a part of the implementation of #42835 resulting from issue #35584. This specific issue was inspired by #35584 (comment).
Bug Report
🔎 Search Terms
uncalled function checks,negation🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Uncalled function checks do not work with the
!operator.🙂 Expected behavior
Unless a function may be undefined it would be very helpful to check whether it is called when it is used with the
!operator.I created this issue to separate a part of the implementation of #42835 resulting from issue #35584. This specific issue was inspired by #35584 (comment).