Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/kt49715.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

24 lines
496 B
Kotlin
Vendored

// IGNORE_BACKEND_K2: JVM_IR, JS_IR
// FIR status: [IR VALIDATION] Duplicate IR node: FUN GENERATED_DATA_CLASS_MEMBER name:toString
// CHECK_BYTECODE_LISTING
// FIR_IDENTICAL
// WITH_STDLIB
import kotlin.test.*
interface A {
fun Any.toString(): String = "hello"
}
data class B(val x: Int) : A {
fun Any.hi() = "hi"
}
fun box(): String {
val b = B(1)
assertEquals("B(x=1)", b.toString())
assertTrue(b == B(1))
assertTrue(1.hashCode() == b.hashCode())
return "OK"
}