Files
kotlin-fork/compiler/testData/diagnostics/tests/UnusedInDestructuring.kt
T
Denis Zharkov 4c69416f2b Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries

 #KT-14347 In Progress
2016-10-24 10:19:25 +03:00

10 lines
296 B
Kotlin
Vendored

data class D(val x: Int, val y: Int, val z: Int)
fun foo(): Int {
val (<!UNUSED_VARIABLE!>x<!>, y, z) = D(1, 2, 3)
return y + z // x is not used, but we cannot do anything with it
}
fun bar(): Int {
val (x, y, <!UNUSED_VARIABLE!>z<!>) = D(1, 2, 3)
return y + x // z is not used
}