dd264cff50
In this commit we have a lot of change in test data. This was caused by the way where we evaluate constants. We split constant evaluation into two distinct parts: only necessary evaluations for `fir2ir` (like const val and annotations) and optimizations for lowering. Now we don't do all constant evaluation on `fir2ir`, but IR dump is executed after this phase, so test data changed. #KT-58923
62 lines
1.0 KiB
Kotlin
Vendored
62 lines
1.0 KiB
Kotlin
Vendored
class C<T : Any?> {
|
|
constructor(t: T) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
val t: T
|
|
field = t
|
|
get
|
|
|
|
override fun hashCode(): Int {
|
|
return <this>.<get-t>() as Int
|
|
}
|
|
|
|
}
|
|
|
|
value class IC<TT : Any?> {
|
|
constructor(c: C<TT>) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
val c: C<TT>
|
|
field = c
|
|
get
|
|
|
|
fun foo(): Int {
|
|
return <this>.<get-c>().hashCode()
|
|
}
|
|
|
|
override operator fun equals(other: Any?): Boolean {
|
|
when {
|
|
other !is IC<TT> -> return false
|
|
}
|
|
val tmp0_other_with_cast: IC<TT> = other as IC<TT>
|
|
when {
|
|
EQEQ(arg0 = <this>.#c, arg1 = tmp0_other_with_cast.#c).not() -> return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
override fun hashCode(): Int {
|
|
return <this>.#c.hashCode()
|
|
}
|
|
|
|
override fun toString(): String {
|
|
return "IC(" + "c=" + <this>.#c + ")"
|
|
}
|
|
|
|
}
|
|
|
|
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"
|
|
}
|
|
|