mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
12 lines
251 B
Kotlin
Vendored
12 lines
251 B
Kotlin
Vendored
data class A(var x: Int) : Cloneable {
|
|
public override fun clone(): A = A(x)
|
|
}
|
|
|
|
fun box(): String {
|
|
val a = A(42)
|
|
val b = a.clone()
|
|
if (b != a) return "Fail equals"
|
|
if (b.identityEquals(a)) return "Fail identity"
|
|
return "OK"
|
|
}
|