KT.UNUSED_UNARY_OPERATOR

Unused unary operator

This rule detects unused unary operators.

Noncompliant Code

Copy
val x = 1 + 2
    + 3 + 4
println(x) // 3

Compliant Code

Copy
val x = 1 + 2 + 3 + 4
println(x) // 10

The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html