mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
The condition of a do-while loop can use variables declared in the loop (variables can only be declared inside a block). Previously this behaviour caused crash because after the block was generated, all variables declared inside that block were gone from myFrameMap #KT-3280 Fixed
13 lines
204 B
Kotlin
Vendored
13 lines
204 B
Kotlin
Vendored
fun box(): String {
|
|
var fx = 1
|
|
var fy = 1
|
|
|
|
do {
|
|
var tmp = fy
|
|
fy = fx + fy
|
|
fx = tmp
|
|
} while (fy < 100)
|
|
|
|
return if (fy == 144) "OK" else "Fail $fx $fy"
|
|
}
|