Simplify for: take into account local property mutability

This commit is contained in:
Mikhail Glukhikh
2016-05-18 19:25:11 +03:00
parent d0fd3dea67
commit 9108ab1923
3 changed files with 20 additions and 0 deletions
@@ -0,0 +1,13 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
data class XY(val x: String, val y: Int)
fun test(xys: Array<XY>) {
for (<caret>xy in xys) {
val x = xy.x
var y = xy.y
println(x + y)
y--
println(y)
}
}