Skip to content

Uncalled-function error with function check in binary expression misses usage in body #41586

Closed
@sandersn

Description

@sandersn
declare var f: () => void
declare var b: boolean
if (f && b) {
    f()
}

Expected behavior:
No error

Actual behavior:
Error: "Did you mean to call 'f'?"

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-repros

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions