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

62 lines
994 B
Kotlin
Vendored

class C<T : Any?> {
val t: T
field = t
get
constructor(t: T) /* primary */ {
super/*Any*/()
/* <init>() */
}
override fun hashCode(): Int {
return <this>.<get-t>() as Int
}
}
value class IC<TT : Any?> {
val c: C<TT>
field = c
get
constructor(c: C<TT>) /* primary */ {
super/*Any*/()
/* <init>() */
}
override operator fun equals(other: Any?): Boolean {
when {
other !is IC<TT> -> return false
}
val tmp_0: IC<TT> = other as IC<TT>
when {
EQEQ(arg0 = <this>.#c, arg1 = tmp_0.#c).not() -> return false
}
return true
}
override fun hashCode(): Int {
return <this>.#c.hashCode()
}
override fun toString(): String {
return "IC(" + "c=" + <this>.#c + ")"
}
fun foo(): Int {
return <this>.<get-c>().hashCode()
}
}
fun box(): String {
val ic: IC<Int> = IC<Int>(c = C<Int>(t = 42))
when {
EQEQ(arg0 = ic.foo(), arg1 = 42).not() -> return "FAIL"
}
return "OK"
}