PSI2IR: generate IrEnumConstructorCalls with correct return type

Normally, the fact that is was Unit was not visible as enum constructors
are lowered to normal class constructors anyway. The exception is when
the arguments are reordered, causing the incorrect return type to leak
into the block that holds temporary variables.
This commit is contained in:
pyos
2019-11-15 11:17:23 +01:00
committed by Dmitry Petrov
parent 145ad1a6fa
commit 35c2573b33
16 changed files with 170 additions and 19 deletions
@@ -0,0 +1,10 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS
fun f(): String = "O"
fun g(): String = "K"
enum class E(val x: String, val y: String) {
A(y = g(), x = f())
}
fun box(): String = E.A.x + E.A.y