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:
Jinseong Jeon
2021-03-18 00:29:09 -07:00
committed by TeamCityServer
parent 08670114c8
commit 7898d167f3
13 changed files with 197 additions and 161 deletions
@@ -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
}