KT.UNNECESSARY_PARENTHESES
Unnecessary parentheses around expressions
This rule reports unnecessary parentheses around expressions. These unnecessary parentheses can safely be removed.
Noncompliant Code
Copy
val local = (5 + 3)
if ((local == 8)) { }
fun foo() {
function({ input -> println(input) })
}
Compliant Code
Copy
val local = 5 + 3
if (local == 8) { }
fun foo() {
function { input -> println(input) }
}