[IR] Add more tests for inline/value classes secondary constructors

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
This commit is contained in:
Evgeniy.Zhelenskiy
2023-04-12 00:59:14 +02:00
committed by Space Team
parent f75b72990e
commit 8c748bfea4
52 changed files with 909 additions and 31 deletions
@@ -0,0 +1,22 @@
// LANGUAGE: +MultiPlatformProjects
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
// MODULE: common
// TARGET_PLATFORM: Common
// FILE: expect.kt
expect value class ExpectValue(val x: String) {
constructor(x: Int)
}
// MODULE: main()()(common)
// TARGET_PLATFORM: JVM
// FILE: actual.kt
@JvmInline
actual value class ExpectValue actual constructor(actual val x: String) {
actual constructor(x: Int) : this(if (x == 42) "OK" else "Not OK: $x")
}
fun box() = ExpectValue(42).x