[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:
committed by
Space Team
parent
888c1defa0
commit
b4413776ab
+12
-7
@@ -4,17 +4,22 @@ FILE: cascadeIf.kt
|
||||
first# -> {
|
||||
^foo IntegerLiteral(4)
|
||||
}
|
||||
second# -> {
|
||||
lval x: <implicit> = IntegerLiteral(3)
|
||||
^foo x#.plus#(IntegerLiteral(2))
|
||||
}
|
||||
else -> {
|
||||
when () {
|
||||
third# -> {
|
||||
^foo IntegerLiteral(0)
|
||||
second# -> {
|
||||
lval x: <implicit> = IntegerLiteral(3)
|
||||
^foo x#.plus#(IntegerLiteral(2))
|
||||
}
|
||||
else -> {
|
||||
^foo IntegerLiteral(-1)
|
||||
when () {
|
||||
third# -> {
|
||||
^foo IntegerLiteral(0)
|
||||
}
|
||||
else -> {
|
||||
^foo IntegerLiteral(-1)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user