[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:
committed by
Space Team
parent
f75b72990e
commit
8c748bfea4
+22
@@ -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
|
||||
Reference in New Issue
Block a user