I was asked today by a new Dart developer why his code didn't produce any diagnostics when he'd missed the () from the end of a method call:
This isn't the first time this has come up to me, and it's also been asked for in the SDK. It seems like a useful lint and it seems like the false positives are real edge cases (like side effects in operators) so I wonder if it would be useful to recommend?
Some issues requesting this (or issues that it may have been avoided if it was used):
Additionally, it is enabled in the Flutter repository:
Possible false positives I can find are all related to operators with side effects (which I think is probably acceptable - I don't think this is common, except perhaps while print-debugging!):
I was asked today by a new Dart developer why his code didn't produce any diagnostics when he'd missed the
()from the end of a method call:This isn't the first time this has come up to me, and it's also been asked for in the SDK. It seems like a useful lint and it seems like the false positives are real edge cases (like side effects in operators) so I wonder if it would be useful to recommend?
Some issues requesting this (or issues that it may have been avoided if it was used):
==expression sdk#30793Additionally, it is enabled in the Flutter repository:
Possible false positives I can find are all related to operators with side effects (which I think is probably acceptable - I don't think this is common, except perhaps while print-debugging!):
unnecessary_statementsshouldn't trigger when the operator is overloaded sdk#59188