Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/kt49715.kt
T
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00

24 lines
489 B
Kotlin
Vendored

// IGNORE_BACKEND_K2: JVM_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"
}