This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To avoid this lint override, you could instead do:
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.
This comes across another lint: https://dart.dev/tools/linter-rules#avoid_function_literals_in_foreach_calls :/
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.
Blech. Well then just ignore my comment for now. If we will eventually get tearoffs for static interop (you could even just have a kernel transform emit a closure like this for static interop tearoffs) maybe we should put a TODO here so that we can remove the lint override?
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.
Well I read your more detailed comment, thanks for the context. I was imagining dynamic tearoff creation but I didn't think about tearoff equality... hmmm.
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.
In general these lint rules are awfully opinionated about things that don't seem to matter all that much 😆
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.
Yeah, even if we were to ignore tearoff equality, the semantics is inconsistent between a regular call and a tear-off call, so in cases where optionality matters, users will still have to battle these lints.
I agree that there shouldn't be a lint for a regular for-loop, but that's my personal opinion. :)