-
Notifications
You must be signed in to change notification settings - Fork 1.8k
manual_{map,filter}: lint exprs with adjustments, but with reduced Applicability
#16037
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
base: master
Are you sure you want to change the base?
Conversation
|
Lintcheck changes for 2af95a4
This comment will be updated if you push new changes |
|
I agree with the idea here, but what do you think about adding a note to the diagnostic if it relies on coercions, like "note: you may need to add an explicit This would make it clearer that the user might need to make some small manual changes on top of the suggestion, since the applicability isn't directly visible. |
|
Right -- I just wasn't sure how to smuggle that note from There's just one more thing: most of the time (maybe? That's what the original issue used as an example at least), One solution would be to just list every (?) possible coercion:
Another solution could be to make WDYT? |
Sounds fine to me to also mention dereferences, but do you have an example where only adding a reference is necessary? The 3 false negatives in #16031 seem like they wouldn't need any extra code changes at all AFAICT. I can come up with cases where adding dereferences or casts/return type annotations on the closure are necessary, but not references. Other than that, this note seems like a good middle ground to me. |
manual_map: lint exprs with adjustments, but with reduced Applicabilitymanual_{map,filter}: lint exprs with adjustments, but with reduced Applicability
ca2ab86 to
01ec211
Compare
Fixes #16031
changelog: [
manual_map]: lint exprs with adjustments, but with reducedApplicabilitychangelog: [
manual_filter]: lint exprs with adjustments, but with reducedApplicability