UNUSED_VARIABLE is now reported only for last entry of destructuring declaration (if applicable) #KT-14221 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-10-07 20:38:00 +03:00
parent 126304c197
commit 8d48b0d2a0
24 changed files with 65 additions and 31 deletions
@@ -0,0 +1,9 @@
data class D(val x: Int, val y: Int, val z: Int)
fun foo(): Int {
val (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
}