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
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:
state.foo;
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):
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_statements
shouldn't trigger when the operator is overloaded sdk#59188The text was updated successfully, but these errors were encountered: