-
Notifications
You must be signed in to change notification settings - Fork 170
Add missed case for prefer_collection_literals #3705
Add missed case for prefer_collection_literals #3705
Conversation
Shows that the check for returning from a function literal is incorrect.
I think someone is working on a "FAILED LINT" syntax for the linter test cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to comment this line so that it's clear that the failure is incorrect.
Even better would be to write this as a reflective test so that it could be marked as a @failingTest
with the correct expectations. (See https://github.com/dart-lang/linter/blob/main/test/rules/prefer_collection_literals_test.dart.)
Other than that, lgtm.
I hope not. We don't need it given that we've decided to switch over to using |
Ah that's good, this PR can be converted to that, then? |
I wouldn't block it from being merged because it hadn't been converted, but that was my suggestion. |
But the introduced test is failing. How could we merge it? |
I didn't notice that. (I mean, who pays attention to the bots? :-) ) Then yes, it needs to be changed, so making it a reflective test makes the most sense. |
This reverts commit 6e295f8.
Test is currently failing because the lint has a bug checking for correct returns within function literals.
I'm pretty sure I got the offset correct... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that the offset is wrong, but it still fails, so it's probably close enough. We have some support coming down the line that will make tests like this much easier to write.
Test is currently failing because the lint has a bug checking for correct returns within function literals.
Shows that the check for returning from a function literal is incorrect.
Description
Please include a summary of the change and a reference to any corresponding issues.
If this is a fix to an existing lint rule or a proposed new one, please include
the name of the rule in the pull request.
If this is a new lint or feature and there is not an existing tracking bug, please
consider opening one to better facilitate conversation.
Fixes # (issue)