Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/kt49715_behaviorChange.kt
T
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00

18 lines
516 B
Kotlin
Vendored

// IGNORE_BACKEND_K2: JVM_IR, JS_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"
}