"Use destructuring declaration": fix it works correctly if variable name is shadowed
#KT-30601 Fixed #KT-20570 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
f4b9c4777f
commit
d61158a176
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user