"Use destructuring declaration": fix it works correctly if variable name is shadowed

#KT-30601 Fixed
#KT-20570 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-01-21 15:56:04 +09:00
committed by Yan Zhulanow
parent f4b9c4777f
commit d61158a176
11 changed files with 128 additions and 5 deletions
@@ -0,0 +1,12 @@
// WITH_RUNTIME
fun main() {
data class A(var x: Int)
val <caret>a = A(0)
val x = a.x
run {
val x = 1
val z = a.x
}
}
@@ -0,0 +1,11 @@
// WITH_RUNTIME
fun main() {
data class A(var x: Int)
val (x1) = A(0)
run {
val x = 1
val z = x1
}
}