Skip to content

Allow parentheses for unclear precedence with range operator#5143

Merged
schalkms merged 1 commit into
detekt:mainfrom
dzirbel:unnecessaryParensRange
Aug 1, 2022
Merged

Allow parentheses for unclear precedence with range operator#5143
schalkms merged 1 commit into
detekt:mainfrom
dzirbel:unnecessaryParensRange

Conversation

@dzirbel

@dzirbel dzirbel commented Jul 28, 2022

Copy link
Copy Markdown
Contributor

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 #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
@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.

4 participants