mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
Before this commit we had two statements blocks for 'for' loops: range variable declaration + iterator variable declaration + while loop. However, BE requires a bit different loop structure to make lowerings properly so in this commit iterator declaration & while loop were extracted to separate block.
13 lines
219 B
Kotlin
Vendored
13 lines
219 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
|
|
fun box(): String {
|
|
val str = "abcd"
|
|
var r = ""
|
|
for (c: Char? in str) {
|
|
r = r + c ?: "?"
|
|
}
|
|
if (r != "abcd") throw AssertionError()
|
|
|
|
return "OK"
|
|
} |