(0, object.property)()
produces TS2695
#35866
Labels
Milestone
(0, object.property)()
produces TS2695
#35866
TypeScript Version: 3.0.0-dev.201xxxxx
Search Terms: Left side of comma operator is unused and has no side effects
(This only brought 7 results in total at the time of writing.)
Code
Expected behavior: It to type-check without errors - this is a common idiom to invoke functions without setting
this
to the property it's on, and it's fairly broadly used.Actual behavior: TS2695: Left side of comma operator is unused and has no side effects on both calls
Playground Link: https://www.typescriptlang.org/play/index.html?ssl=3&ssc=11&pln=3&pc=5#code/DYUwLgBMCWDOkF4IG0AUBKCCB8EDeEAvgLoDcAUKgAwA0UcYyVx6GFokA9gEYBWIAY0T4AZgDsAXBAxZcBQoQrU6PfkIB041ulJA
Related Issues: #12978 #33646
The text was updated successfully, but these errors were encountered: