[Raw FIR] Build if - else if - else as two nested whens

This is necessary for inference to work like in K1 because we only
add equality constraints from expected types on top-level `when`, not
on nested ones.

#KT-65882
This commit is contained in:
Kirill Rakhman
2024-02-29 14:56:10 +01:00
committed by Space Team
parent 888c1defa0
commit b4413776ab
12 changed files with 390 additions and 338 deletions
@@ -46,11 +46,16 @@ FILE: kt53494.kt
!=(R|<local>/t|, Null(null)) -> {
R|/Wrapped.Wrapped|<R|T? & Any|>(R|<local>/t|)
}
(R|<local>/t| is R|T|) -> {
R|/Wrapped.Wrapped|<R|it(kotlin/Nothing? & T)|>(R|<local>/t|)
}
else -> {
Q|Default|
when () {
(R|<local>/t| is R|T|) -> {
R|/Wrapped.Wrapped|<R|it(kotlin/Nothing? & T)|>(R|<local>/t|)
}
else -> {
Q|Default|
}
}
}
}