Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/toString/alreadyDeclaredWrongSignature.kt
T

22 lines
464 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_RUNTIME
data class A(val x: Int) {
fun toString(other: Any): String = ""
}
data class B(val x: Int) {
fun toString(other: B, another: Any): String = ""
}
fun box(): String {
A::class.java.getDeclaredMethod("toString")
A::class.java.getDeclaredMethod("toString", Any::class.java)
B::class.java.getDeclaredMethod("toString")
B::class.java.getDeclaredMethod("toString", B::class.java, Any::class.java)
return "OK"
}