-
Notifications
You must be signed in to change notification settings - Fork 1.7k
cascade_invocations
false positives
#58050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Why is this a false positive? What's wrong with: items
..clear()
..addAll([g]); ? |
The problem is with void! |
Could you be a little more explicit? I don't see any particular problem caused by |
@vr19860507 If you believe there would be some problem from |
Just enable "cascade_invocations". And just paste this code
into the editor. And you will understand what I'm talking about! |
@vr19860507 The lint is telling you that you can use the cascade operator instead, as I showed in #58050. The lint seems correct; what makes you think that it is a false positive? |
Try running the following code:
This will print out two identical lines because the two ways of writing the code are equivalent. In both cases any exiting contents of the list are removed (the invocation of I suspect that what wasn't clear is that the cascade operator means to invoke both |
@bwilkerson @jamesderlin Checked it now, it works!
But I remember exactly that when I opened this issue it did not work... I don't know, maybe I was mistaken, or maybe they fixed it... Thank you anyway! |
You're welcome. I'm glad it's working for you. |
cascade_invocations false positives
The text was updated successfully, but these errors were encountered: