Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/equals/alreadyDeclaredWrongSignature.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

37 lines
903 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_STDLIB
data class B(val x: Int) {
fun equals(other: B): Boolean = false
}
data class C(val x: Int) {
fun equals(): Boolean = false
}
data class D(val x: Int) {
fun equals(other: Any?, another: String): Boolean = false
}
data class E(val x: Int) {
fun equals(x: E): Boolean = false
override fun equals(x: Any?): Boolean = false
}
fun box(): String {
B::class.java.getDeclaredMethod("equals", Any::class.java)
B::class.java.getDeclaredMethod("equals", B::class.java)
C::class.java.getDeclaredMethod("equals", Any::class.java)
C::class.java.getDeclaredMethod("equals")
D::class.java.getDeclaredMethod("equals", Any::class.java)
D::class.java.getDeclaredMethod("equals", Any::class.java, String::class.java)
E::class.java.getDeclaredMethod("equals", Any::class.java)
E::class.java.getDeclaredMethod("equals", E::class.java)
return "OK"
}