[FE 1.0] Record USED_AS_EXPRESSION for unreachable CFG nodes
^KT-48708 Fixed
This commit is contained in:
committed by
teamcityserver
parent
8464b15d27
commit
d390f881c8
@@ -0,0 +1,13 @@
|
||||
fun test(b: Boolean) {
|
||||
val x: Int = when {
|
||||
b -> 3
|
||||
else -> { // BLOCK
|
||||
throw Exception()
|
||||
0
|
||||
}
|
||||
}
|
||||
takeInt(x = x)
|
||||
}
|
||||
|
||||
fun takeInt(x: Int) {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
FILE fqName:<root> fileName:/kt48708.kt
|
||||
FUN name:test visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:b index:0 type:kotlin.Boolean
|
||||
BLOCK_BODY
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: GET_VAR 'b: kotlin.Boolean declared in <root>.test' type=kotlin.Boolean origin=null
|
||||
then: CONST Int type=kotlin.Int value=3
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BLOCK type=kotlin.Int origin=null
|
||||
THROW type=kotlin.Nothing
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () declared in java.lang.Exception' type=java.lang.Exception origin=null
|
||||
CONST Int type=kotlin.Int value=0
|
||||
CALL 'public final fun takeInt (x: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
FUN name:takeInt visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
@@ -0,0 +1,13 @@
|
||||
// ISSUE: KT-48708
|
||||
|
||||
fun test(b: Boolean) {
|
||||
val x = if (b) {
|
||||
3
|
||||
} else {
|
||||
throw Exception()
|
||||
0
|
||||
}
|
||||
takeInt(x)
|
||||
}
|
||||
|
||||
fun takeInt(x: Int) {}
|
||||
@@ -0,0 +1,15 @@
|
||||
fun test(b: Boolean) {
|
||||
val x: Int = when {
|
||||
b -> { // BLOCK
|
||||
3
|
||||
}
|
||||
else -> { // BLOCK
|
||||
throw Exception()
|
||||
0
|
||||
}
|
||||
}
|
||||
takeInt(x = x)
|
||||
}
|
||||
|
||||
fun takeInt(x: Int) {
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
FILE fqName:<root> fileName:/kt48708.kt
|
||||
FUN name:test visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:b index:0 type:kotlin.Boolean
|
||||
BLOCK_BODY
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: GET_VAR 'b: kotlin.Boolean declared in <root>.test' type=kotlin.Boolean origin=null
|
||||
then: BLOCK type=kotlin.Int origin=null
|
||||
CONST Int type=kotlin.Int value=3
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BLOCK type=kotlin.Int origin=null
|
||||
THROW type=kotlin.Nothing
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () declared in java.lang.Exception' type=java.lang.Exception origin=null
|
||||
CONST Int type=kotlin.Int value=0
|
||||
CALL 'public final fun takeInt (x: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
FUN name:takeInt visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
Reference in New Issue
Block a user