-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix let_unit_value to lint when explicit unit type annotation is present #15975
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?
Fix let_unit_value to lint when explicit unit type annotation is present #15975
Conversation
This comment has been minimized.
This comment has been minimized.
Remove the early return that was skipping let bindings with explicit `()` type annotations. The lint should trigger for redundant unit bindings regardless of whether the type is explicitly annotated or inferred.
b2809e4 to
90a46e9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
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.
Error markers should be identical to the other one used for testing this lint (let_unit_value, not ERROR). LLM generated probably?
Also please don't use lengthy LLM generated messages for the PR description, this is tedious to read and brings little value.
Fixed, that's for pointing that out.
Understood. Sorry for the excess. I've shortened the description to just the changelog entry, reference to issue number, and short description. |
|
@Jarcho @samueltardieu @Urgau @blyxyas Could we please re-review the changes and consider merging? |
|
Hmm I'm not sure if this change is beneficial. This code was already allowed and it raised this issue #12017, maybe it's better to lose this as a false negative, than to annoy users when it could be an important component for type-ensurance. |
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.
Registering the previously raised concern into Github to prevent merging before it's resolved
|
Reminder, once the PR becomes ready for a review, use |
changelog: [
let_unit_value]: Now lints when explicit unit type annotation is presentfixes #15957
This PR fixes the
let_unit_valuelint to trigger even when an explicit()type annotation is present.