Skip to content

UnnecessaryParentheses: fix false positive for delegated expressions#3858

Merged
schalkms merged 1 commit into
detekt:mainfrom
cortinico:nc/fix-UnnecessaryParentheses-false-positive
Jun 6, 2021
Merged

UnnecessaryParentheses: fix false positive for delegated expressions#3858
schalkms merged 1 commit into
detekt:mainfrom
cortinico:nc/fix-UnnecessaryParentheses-false-positive

Conversation

@cortinico
Copy link
Copy Markdown
Member

Fixes #3851

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2021

Codecov Report

Merging #3858 (af1bdb8) into main (4efa571) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #3858   +/-   ##
=========================================
  Coverage     83.64%   83.64%           
- Complexity     3115     3116    +1     
=========================================
  Files           456      456           
  Lines          8965     8966    +1     
  Branches       1746     1747    +1     
=========================================
+ Hits           7499     7500    +1     
  Misses          552      552           
  Partials        914      914           
Impacted Files Coverage Δ
...bosch/detekt/rules/style/UnnecessaryParentheses.kt 76.92% <100.00%> (+1.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4efa571...af1bdb8. Read the comment docs.

@picklebento picklebento added this to the 1.18.0 milestone Jun 6, 2021
@schalkms schalkms merged commit 3bc9fd2 into detekt:main Jun 6, 2021
@cortinico cortinico added the rules label Jun 6, 2021
@BraisGabin
Copy link
Copy Markdown
Member

This rule delegates all the heavy lifting on KtPsiUtil.areParenthesesUseless(expression). Shouldn't we open an issue to JetBrains to fix it?

I'm not sure if this is an issue in areParenthesesUseless or even the compiler. I don't see why those parentheses are needed.

@cortinico
Copy link
Copy Markdown
Member Author

I'm not sure if this is an issue in areParenthesesUseless or even the compiler. I don't see why those parentheses are needed.

True. I've created an issue here https://youtrack.jetbrains.com/issue/KT-47159
Will try to ask on Slack if someone has insights on this.

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.

UnnecessaryParentheses is invalid for expressions used for delegation.

4 participants