Files
kotlin/compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexNotDestructured.kt
2019-11-20 13:02:21 +01:00

19 lines
434 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
import kotlin.test.assertEquals
fun box(): String {
val indexList = mutableListOf<Int>()
val valueList = mutableListOf<Int>()
for (iv in (4..7).withIndex()) {
val (i, v) = iv
indexList += i
valueList += v
}
assertEquals(listOf(0, 1, 2, 3), indexList)
assertEquals(listOf(4, 5, 6, 7), valueList)
return "OK"
}