Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/secondaryConstructorExpectActual.kt
T
Evgeniy.Zhelenskiy 8c748bfea4 [IR] Add more tests for inline/value classes secondary constructors
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
2023-04-17 12:10:14 +00:00

23 lines
483 B
Kotlin
Vendored

// 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