Skip to content
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

Allow parentheses for unclear precedence with range operator #5143

Merged
merged 1 commit into from Aug 1, 2022

Conversation

dzirbel
Copy link
Contributor

@dzirbel dzirbel commented Jul 28, 2022

Follow-up to #4881 to allow parentheses clarifying usage of the range operator (..). Since for example IntRange has a plus(Int) operator function, the expression a..b +c could be ambiguous (but is interpreted as a..(b + c)). We can allow clarifying parentheses for such cases.

@github-actions github-actions bot added the rules label Jul 28, 2022
Follow-up to detekt#4881 to allow parentheses clarifying usage of the range operator (`..`). Since for example `IntRange` has a `plus(Int)` operator function, the expression `a..b +c` could be ambiguous (but is interpreted as `a..(b + c)`). We can allow clarifying parentheses for such cases.
@cortinico cortinico added this to the 1.22.0 milestone Jul 30, 2022
@schalkms schalkms merged commit fe731ab into detekt:main Aug 1, 2022
19 checks passed
@dzirbel dzirbel deleted the unnecessaryParensRange branch August 1, 2022 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants