[FIR] Try to infer result type of incomplete when expression

^KT-62069 Fixed
This commit is contained in:
Ivan Kochurkin
2023-11-17 12:51:56 +01:00
committed by Space Team
parent e2f245096c
commit 88f7b085e6
28 changed files with 113 additions and 59 deletions
@@ -1,12 +1,12 @@
FILE: missingBooleanBranch.kt
public final fun test_1(cond: R|kotlin/Boolean|): R|kotlin/Unit| {
lval x: R|kotlin/Unit| = when (R|<local>/cond|) {
lval x: R|kotlin/Int| = when (R|<local>/cond|) {
==($subj$, Boolean(true)) -> {
Int(1)
}
}
lval y: R|kotlin/Unit| = when (R|<local>/cond|) {
lval y: R|kotlin/Int| = when (R|<local>/cond|) {
==($subj$, Boolean(false)) -> {
Int(2)
}
@@ -23,7 +23,7 @@ FILE: missingBooleanBranch.kt
}
public final fun test_2(cond: R|kotlin/Boolean?|): R|kotlin/Unit| {
lval x: R|kotlin/Unit| = when (R|<local>/cond|) {
lval x: R|kotlin/Int| = when (R|<local>/cond|) {
==($subj$, Boolean(true)) -> {
Int(1)
}