Files
kotlin-fork/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt
T
2024-02-16 10:19:38 +00:00

60 lines
1.2 KiB
Kotlin
Vendored

data class Test<T : Any?> {
val x: T
field = x
get
val y: String
field = y
get
constructor(x: T, y: String = "") /* primary */ {
super/*Any*/()
/* <init>() */
}
operator fun component1(): T {
return <this>.#x
}
operator fun component2(): String {
return <this>.#y
}
fun copy(x: T = <this>.#x, y: String = <this>.#y): Test<T> {
return Test<T>(x = x, y = y)
}
override operator fun equals(other: Any?): Boolean {
when {
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
}
when {
other !is Test<T> -> return false
}
val tmp_0: Test<T> = other as Test<T>
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp_0.#x).not() -> return false
}
when {
EQEQ(arg0 = <this>.#y, arg1 = tmp_0.#y).not() -> return false
}
return true
}
override fun hashCode(): Int {
var result: Int = when {
EQEQ(arg0 = <this>.#x, arg1 = null) -> 0
else -> <this>.#x.hashCode()
}
result = result.times(other = 31).plus(other = <this>.#y.hashCode())
return result
}
override fun toString(): String {
return "Test(" + "x=" + <this>.#x + ", " + "y=" + <this>.#y + ")"
}
}