JVM_IR: Do not copy static init blocks to inline class's constructor

#KT-58593 Fixed
This commit is contained in:
Ilmir Usmanov
2023-05-19 10:56:45 +02:00
committed by Space Team
parent 74c57e6057
commit a0484de1a6
18 changed files with 172 additions and 0 deletions
@@ -0,0 +1,32 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
// CHECK_BYTECODE_LISTING
// IGNORE_BACKEND: JVM
var res = ""
OPTIONAL_JVM_INLINE_ANNOTATION
value class IC(val s: String) {
init {
res += "IC"
}
companion object {
init {
res += "companion"
}
val ok = "OK"
}
}
fun box(): String {
IC.ok
if (res != "companion") return "FAIL 1: $res"
res = ""
IC("")
if (res != "IC") return "FAIL 2: $res"
return "OK"
}