Files
kotlin-fork/compiler/testData/diagnostics/tests/constructorConsistency/comparison.kt
T
2016-06-03 09:45:37 +03:00

11 lines
320 B
Kotlin
Vendored

val instance = My()
class My {
val equalsInstance = (<!DEBUG_INFO_LEAKING_THIS!>this<!> == instance)
val isInstance = if (this === instance) "true" else "false"
override fun equals(other: Any?) =
other is My && isInstance.hashCode() == <!DEBUG_INFO_SMARTCAST!>other<!>.isInstance.hashCode()
}