[FIR2IR] Correctly generate delegating constructor call for secondary constructors in enums
^KT-56927 Fxied
This commit is contained in:
committed by
Space Team
parent
a818c543a9
commit
7958a9debd
@@ -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
-2
@@ -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
-2
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user