Files
kotlin-fork/compiler/testData/codegen/box/ranges/forInCharSequenceLengthDecreasedInLoopBody.kt
T
2019-11-19 11:00:09 +03:00

17 lines
346 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
import kotlin.test.*
fun box(): String {
val sb = StringBuilder("1234")
val result = StringBuilder()
for (c in sb) {
sb.clear()
result.append(c)
}
assertEquals("", sb.toString())
assertEquals("1", result.toString())
return "OK"
}