Files
Jaebaek Seo 86c498f7c5 Add K2 EqualsOrHashCodeInspection
^KTIJ-22907 fixed

GitOrigin-RevId: 7e6b347b06eb17b9ca2c4f3ecb997ed8fbb2ef00
2022-11-15 15:53:29 +00:00

25 lines
598 B
Plaintext

// ERROR: Unresolved reference: javaClass
// ERROR: Unresolved reference: javaClass
open class Base() {
override fun hashCode(): Int = 0
fun equals(base: Base?) = false
}
class WithConstructor(x: Int, s: String) : Base() {
val x: Int = 0
val s: String = ""
override fun hashCode(): Int = 1
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as WithConstructor
if (x != other.x) return false
if (s != other.s) return false
return true
}
}