[FIR2IR] Correctly generate delegating constructor call for secondary constructors in enums

^KT-56927 Fxied
This commit is contained in:
Dmitriy Novozhilov
2023-04-27 12:19:58 +03:00
committed by Space Team
parent a818c543a9
commit 7958a9debd
9 changed files with 20 additions and 17 deletions
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_K2: JS_IR, NATIVE
enum class Test {
A(0),
B;
@@ -14,4 +12,4 @@ fun box(): String =
if (Test.A.n == Test.B.n)
"OK"
else
"Fail"
"Fail"
@@ -1,8 +1,7 @@
// IGNORE_BACKEND_K2: JS_IR, NATIVE
enum class Test(val x: Int, val str: String) {
OK;
constructor(x: Int = 0) : this(x, "OK")
}
fun box(): String =
Test.OK.str
Test.OK.str
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_K2: JS_IR, NATIVE
enum class Test(val x: Int, val str: String) {
OK;
constructor(vararg xs: Int) : this(xs.size + 42, "OK")
@@ -8,4 +7,4 @@ fun box(): String =
if (Test.OK.x == 42)
Test.OK.str
else
"Fail"
"Fail"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_K2: JS_IR, NATIVE
package test
enum class My(val s: String) {