[FIR] Fix detecting that if in then branch of outer if used as expression
This commit is contained in:
committed by
TeamCityServer
parent
e6588ee8a4
commit
671ebc6819
Vendored
+20
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun run(block: () -> Unit) {}
|
||||
|
||||
fun test(b1: Boolean, b2: Boolean) {
|
||||
var result = false
|
||||
run {
|
||||
if (b1)
|
||||
if (b2)
|
||||
result = true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user