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
@@ -1,8 +1,12 @@
|
||||
fun test1() {
|
||||
while (true) break
|
||||
dobreak while (true)
|
||||
{ // BLOCK
|
||||
dobreak while (true)
|
||||
}
|
||||
while (true) continue
|
||||
docontinue while (true)
|
||||
{ // BLOCK
|
||||
docontinue while (true)
|
||||
}
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
|
||||
@@ -4,15 +4,17 @@ FILE fqName:<root> fileName:/breakContinue.kt
|
||||
WHILE label=null origin=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value=true
|
||||
body: BREAK label=null loop.label=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: BREAK label=null loop.label=null
|
||||
condition: CONST Boolean type=kotlin.Boolean value=true
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: BREAK label=null loop.label=null
|
||||
condition: CONST Boolean type=kotlin.Boolean value=true
|
||||
WHILE label=null origin=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value=true
|
||||
body: CONTINUE label=null loop.label=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: CONTINUE label=null loop.label=null
|
||||
condition: CONST Boolean type=kotlin.Boolean value=true
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: CONTINUE label=null loop.label=null
|
||||
condition: CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
WHILE label=OUTER origin=WHILE_LOOP
|
||||
|
||||
+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
|
||||
}
|
||||
|
||||
+16
-15
@@ -109,21 +109,22 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
|
||||
GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
VAR name:j type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
DO_WHILE label=Inner origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Int origin=DO_WHILE_LOOP
|
||||
SET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
condition: WHEN type=kotlin.Boolean origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun greaterOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ
|
||||
arg0: GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=3
|
||||
then: CONST Boolean type=kotlin.Boolean value=false
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BREAK label=Outer loop.label=Outer
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=Inner origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Int origin=DO_WHILE_LOOP
|
||||
SET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
condition: WHEN type=kotlin.Boolean origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun greaterOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ
|
||||
arg0: GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=3
|
||||
then: CONST Boolean type=kotlin.Boolean value=false
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BREAK label=Outer loop.label=Outer
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
|
||||
@@ -24,9 +24,11 @@ fun testBreakWhile() {
|
||||
|
||||
fun testBreakDoWhile() {
|
||||
var k: Int = 0
|
||||
dowhen {
|
||||
greater(arg0 = k, arg1 = 2) -> break
|
||||
} while (less(arg0 = k, arg1 = 10))
|
||||
{ // BLOCK
|
||||
dowhen {
|
||||
greater(arg0 = k, arg1 = 2) -> break
|
||||
} while (less(arg0 = k, arg1 = 10))
|
||||
}
|
||||
}
|
||||
|
||||
fun testContinueFor() {
|
||||
@@ -56,14 +58,16 @@ fun testContinueWhile() {
|
||||
fun testContinueDoWhile() {
|
||||
var k: Int = 0
|
||||
var s: String = ""
|
||||
do// COMPOSITE {
|
||||
k = k.inc()
|
||||
k /*~> Unit */
|
||||
when {
|
||||
greater(arg0 = k, arg1 = 2) -> continue
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
k = k.inc()
|
||||
k /*~> Unit */
|
||||
when {
|
||||
greater(arg0 = k, arg1 = 2) -> continue
|
||||
}
|
||||
s = s.plus(other = k.toString() + ";")
|
||||
// } while (less(arg0 = k, arg1 = 10))
|
||||
}
|
||||
s = s.plus(other = k.toString() + ";")
|
||||
// } while (less(arg0 = k, arg1 = 10))
|
||||
when {
|
||||
EQEQ(arg0 = s, arg1 = "1;2;").not() -> throw AssertionError(p0 = s)
|
||||
}
|
||||
|
||||
@@ -47,16 +47,17 @@ FILE fqName:<root> fileName:/breakContinueInWhen.kt
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
FUN name:testContinueFor visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:xs type:kotlin.IntArray [val]
|
||||
@@ -107,29 +108,30 @@ FILE fqName:<root> fileName:/breakContinueInWhen.kt
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR name:s type:kotlin.String [var]
|
||||
CONST String type=kotlin.String value=""
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
SET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
SET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=null
|
||||
other: STRING_CONCATENATION type=kotlin.String
|
||||
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
CONST String type=kotlin.String value=";"
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
SET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
SET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=null
|
||||
other: STRING_CONCATENATION type=kotlin.String
|
||||
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
CONST String type=kotlin.String value=";"
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
|
||||
+19
-11
@@ -12,18 +12,24 @@ fun test() {
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
}
|
||||
do// COMPOSITE {
|
||||
// } while (less(arg0 = x, arg1 = 0))
|
||||
do{ // BLOCK
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
// } while (less(arg0 = x, arg1 = 0))
|
||||
}
|
||||
{ // BLOCK
|
||||
do{ // BLOCK
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
} while (less(arg0 = x, arg1 = 15))
|
||||
}
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
} while (less(arg0 = x, arg1 = 15))
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
// } while (less(arg0 = x, arg1 = 20))
|
||||
// } while (less(arg0 = x, arg1 = 20))
|
||||
}
|
||||
}
|
||||
|
||||
fun testSmartcastInCondition() {
|
||||
@@ -32,8 +38,10 @@ fun testSmartcastInCondition() {
|
||||
a is Boolean -> { // BLOCK
|
||||
while (a /*as Boolean */) { // BLOCK
|
||||
}
|
||||
do// COMPOSITE {
|
||||
// } while (a /*as Boolean */)
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
// } while (a /*as Boolean */)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+35
-31
@@ -30,33 +30,36 @@ FILE fqName:<root> fileName:/whileDoWhile.kt
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
|
||||
GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
SET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=15
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Int origin=DO_WHILE_LOOP
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
|
||||
GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
SET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=20
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
|
||||
GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
SET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=15
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Int origin=DO_WHILE_LOOP
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
|
||||
GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
SET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=20
|
||||
FUN name:testSmartcastInCondition visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:a type:kotlin.Any? [val]
|
||||
@@ -70,7 +73,8 @@ FILE fqName:<root> fileName:/whileDoWhile.kt
|
||||
condition: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
|
||||
GET_VAR 'val a: kotlin.Any? [val] declared in <root>.testSmartcastInCondition' type=kotlin.Any? origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
condition: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
|
||||
GET_VAR 'val a: kotlin.Any? [val] declared in <root>.testSmartcastInCondition' type=kotlin.Any? origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
condition: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
|
||||
GET_VAR 'val a: kotlin.Any? [val] declared in <root>.testSmartcastInCondition' type=kotlin.Any? origin=null
|
||||
|
||||
Reference in New Issue
Block a user