Generate do-while condition within loop body scope

This commit is contained in:
Dmitry Petrov
2017-05-04 13:38:59 +03:00
parent fdb4de355c
commit 8e84862afa
6 changed files with 116 additions and 34 deletions
@@ -0,0 +1,5 @@
fun foo() {
do {
val x = 42
} while (x != 42)
}
@@ -0,0 +1,12 @@
FILE /localVarInDoWhile.kt
FUN public fun foo(): kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=null
DO_WHILE label=null origin=DO_WHILE_LOOP
body: COMPOSITE type=kotlin.Unit origin=null
VAR val x: kotlin.Int = 42
CONST Int type=kotlin.Int value='42'
condition: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'x: Int' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value='42'