[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
+11
@@ -0,0 +1,11 @@
|
||||
// WITH_STDLIB
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
@JvmInline
|
||||
value class A<!CONFLICTING_JVM_DECLARATIONS!>(val x: Int)<!> {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: UInt)<!>: this(x.toInt())
|
||||
}
|
||||
|
||||
data class B<!CONFLICTING_JVM_DECLARATIONS!>(val x: UInt)<!> {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: Int)<!> : this(x.toUInt())
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// WITH_STDLIB
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
@JvmInline
|
||||
value class <!CONFLICTING_JVM_DECLARATIONS!>A(val x: Int)<!> {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: UInt)<!>: this(x.toInt())
|
||||
}
|
||||
|
||||
data class <!CONFLICTING_JVM_DECLARATIONS!>B(val x: UInt)<!> {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: Int)<!> : this(x.toUInt())
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !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!>B<!CONFLICTING_JVM_DECLARATIONS!>(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())
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !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())
|
||||
}
|
||||
Reference in New Issue
Block a user