Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/kt49715_behaviorChange.kt
T
Alexander Udalov df86290083 Add another test for KT-49715 and fix JS IR behavior
#KT-49715
 #KT-51798 Fixed
2022-04-05 01:06:57 +02:00

18 lines
510 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: [IR VALIDATION] Duplicate IR node: FUN GENERATED_DATA_CLASS_MEMBER name:equals
interface A {
fun Any.equals(other: Any?): Boolean = false
fun Any.hashCode(): Int = 0
fun Any.toString(): String = ""
}
data class B(val x: Int) : A
fun box(): String {
if (B(42) != B(42)) return "Fail equals"
if (B(42).hashCode() != B(42).hashCode()) return "Fail hashCode"
if (B(42).toString() != B(42).toString()) return "Fail toString"
return "OK"
}