prefer_foreach
message and suggested fix is unclear
#56995
Labels
analyzer-quick-fix
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
type-enhancement
A request for a change that isn't a bug
Describe the issue
The lint asks me to use a forEach instead of a for loop for passing in function literals, but once it converts it to a for loop I get a new warning tell me to use forEach for applying functions. From discussion with the analyzer team, it seems like the second lint wants me to convert it to using a foreach with a tear-off, but no fix is offered.
To Reproduce
https://github.com/user-attachments/assets/df5b40c3-5e19-4675-a704-38d35d6f52a9
Expected behavior
Either the fix for the lint should have changed it to an acceptable state, or the message should have been more clear.
The text was updated successfully, but these errors were encountered: