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

This reverts commit d61158a1
This commit is contained in:
Yan Zhulanow
2020-10-24 00:19:10 +09:00
parent ab70cc35ea
commit f615ed2f26
11 changed files with 5 additions and 128 deletions
@@ -2,9 +2,9 @@
data class XY(val x: Int, val y: Int)
fun test(xys: Array<XY>) {
xys.forEach { (x, y1) ->
xys.forEach { (x, y) ->
println(x)
val y = y1 + x
val y = y + x
println(y)
}
}
@@ -1,9 +0,0 @@
// WITH_RUNTIME
data class Event(val timestamp: Int, val otherVar: Int = 1, val otherVar2: String = "")
val listA = listOf(Event(1), Event(2), Event(3))
val listB = listOf(Event(1), Event(2), Event(3))
fun test2() {
listA.zip(listB) { (timestamp), <caret>it2 -> timestamp + it2.timestamp }
}
@@ -1,9 +0,0 @@
// WITH_RUNTIME
data class Event(val timestamp: Int, val otherVar: Int = 1, val otherVar2: String = "")
val listA = listOf(Event(1), Event(2), Event(3))
val listB = listOf(Event(1), Event(2), Event(3))
fun test2() {
listA.zip(listB) { (timestamp), (timestamp1) -> timestamp + timestamp1 }
}
@@ -1,15 +0,0 @@
// WITH_RUNTIME
data class A(var x: Int)
fun convert(f: (A) -> Unit) {}
fun test() {
convert <caret>{
val x = it.x
run {
val x = 1
val z = it.x
}
}
}
@@ -1,14 +0,0 @@
// WITH_RUNTIME
data class A(var x: Int)
fun convert(f: (A) -> Unit) {}
fun test() {
convert { (x1) ->
run {
val x = 1
val z = x1
}
}
}
@@ -1,15 +0,0 @@
// WITH_RUNTIME
data class A(var x: Int)
fun convert(f: (A) -> Unit) {}
fun test() {
convert { <caret>a ->
val x = a.x
run {
val x = 1
val z = a.x
}
}
}
@@ -1,14 +0,0 @@
// WITH_RUNTIME
data class A(var x: Int)
fun convert(f: (A) -> Unit) {}
fun test() {
convert { (x1) ->
run {
val x = 1
val z = x1
}
}
}
@@ -1,12 +0,0 @@
// 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
}
}
@@ -1,11 +0,0 @@
// WITH_RUNTIME
fun main() {
data class A(var x: Int)
val (x1) = A(0)
run {
val x = 1
val z = x1
}
}