You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uncalled function checks don't work with negationΒ #43096
declarefunctionisFoo(): boolean;declareconstisUndefinedFoo: (()=>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).
Activity
alexthemark commentedon Jan 17, 2024
This bug hit my codebase earlier this week.
Would the Typescript team accept a pull request for this?