No "did you mean to call" error when invocation is part of a logical expression #40197
Labels
Breaking Change
Would introduce errors in existing code
Experience Enhancement
Noncontroversial enhancements
Suggestion
An idea for TypeScript
Milestone
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: v4.1.0-dev.20200822
Search Terms: "did you mean to call"
Code
Expected behavior:
The same error (2774) on the access of
foo
in bothis_foo_1
andis_foo_2
.Actual behavior:
Only
is_foo_1
shows the error. However, from a logical standpoint, I would consider them to be equally incorrect.!foo
doesn't give an error either.Playground Link:
https://www.typescriptlang.org/play?ts=4.1.0-dev.20200822#code/GYVwdgxgLglg9mABMOcAUBKRBvRAnAUyhDyWAEMAbAZwMQF8AoUSWBRGagfRTi4EZMOfERJlUiAPyJ+iAFyIADA2bho8JJx6ouAJiG5CxUsgkAyMzIZA
Related Issues:
I found discussions about the implementation of this error, but nothing specific to logical expressions.
The text was updated successfully, but these errors were encountered: