Pattern: Unused private property
Issue: -
An unused private property can be removed to simplify the source file.
This rule also detects unused constructor parameters since these can become
properties of the class when they are declared with val
or var
.
Example of incorrect code:
class Foo {
private val unused = "unused"
}
Example of correct code:
class Foo {
private val used = "used"
fun greet() {
println(used)
}
}