Files
kotlin/compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInStringWithIndex.kt
2018-01-23 10:55:24 +03:00

12 lines
241 B
Kotlin
Vendored

// WITH_RUNTIME
fun box(): String {
val s = StringBuilder()
for ((index, x) in "abcd".withIndex()) {
s.append("$index:$x;")
}
val ss = s.toString()
return if (ss == "0:a;1:b;2:c;3:d;") "OK" else "fail: '$ss'"
}