FIR2IR: wrap do-while loop in IrBlock
"so that variables declared in loop body are not visible outside of the
loop" (from commit d096f1d)
This commit is contained in:
committed by
TeamCityServer
parent
08670114c8
commit
7898d167f3
+9
-7
@@ -64,13 +64,15 @@ fun test5() {
|
||||
i = i.inc()
|
||||
i /*~> Unit */
|
||||
var j: Int = 0
|
||||
Inner@ do// COMPOSITE {
|
||||
j = j.inc()
|
||||
j
|
||||
// } while (when {
|
||||
greaterOrEqual(arg0 = j, arg1 = 3) -> false
|
||||
else -> break@Outer
|
||||
})
|
||||
{ // BLOCK
|
||||
Inner@ do// COMPOSITE {
|
||||
j = j.inc()
|
||||
j
|
||||
// } while (when {
|
||||
greaterOrEqual(arg0 = j, arg1 = 3) -> false
|
||||
else -> break@Outer
|
||||
})
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = i, arg1 = 3) -> break@Outer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user