[FIR] Fix detecting that if in then branch of outer if used as expression

This commit is contained in:
Dmitriy Novozhilov
2021-02-10 11:31:39 +03:00
committed by TeamCityServer
parent e6588ee8a4
commit 671ebc6819
7 changed files with 49 additions and 2 deletions
@@ -0,0 +1,20 @@
FILE: nestedIfInLambda.kt
public final fun run(block: R|() -> kotlin/Unit|): R|kotlin/Unit| {
}
public final fun test(b1: R|kotlin/Boolean|, b2: R|kotlin/Boolean|): R|kotlin/Unit| {
lvar result: R|kotlin/Boolean| = Boolean(false)
R|/run|(<L> = run@fun <anonymous>(): R|kotlin/Unit| {
when () {
R|<local>/b1| -> {
when () {
R|<local>/b2| -> {
R|<local>/result| = Boolean(true)
}
}
}
}
}
)
}
@@ -0,0 +1,10 @@
fun run(block: () -> Unit) {}
fun test(b1: Boolean, b2: Boolean) {
var result = false
run {
if (b1)
if (b2)
result = true
}
}