mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
Extensions on nullable types remain in Library.kt #KT-1741 Obsolete #KT-2805 Obsolete #KT-1365 Fixed #KT-4517 In Progress
16 lines
263 B
Kotlin
16 lines
263 B
Kotlin
class C(val x: Int) {
|
|
override fun equals(rhs: Any?): Boolean {
|
|
if (rhs is C) {
|
|
val rhsC = rhs as C
|
|
return rhsC.x == x
|
|
}
|
|
return false
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val c1 = C(10)
|
|
val c2 = C(10)
|
|
return if (c1 == c2) "OK" else "fail"
|
|
}
|