Files
kotlin-fork/compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature/valueClasses/declarationClash.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

15 lines
598 B
Kotlin
Vendored

// !LANGUAGE: +ValueClasses
// WITH_STDLIB
// TARGET_BACKEND: JVM_IR
@JvmInline
value class A(val x: Int, val y: Int) {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A)<!>: this(other.x, other.y)
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: UInt, y: UInt)<!>: this(x.toInt(), y.toInt())
}
data class <!CONFLICTING_JVM_DECLARATIONS, CONFLICTING_JVM_DECLARATIONS!>B(val x: UInt, val y: UInt)<!> {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(other: A)<!> : this(other.x, other.y)
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: Int, y: Int)<!> : this(x.toUInt(), y.toUInt())
}