diff --git a/kotlin-native/runtime/src/main/cpp/Natives.cpp b/kotlin-native/runtime/src/main/cpp/Natives.cpp index 06b836efe01..dbea80ff3cc 100644 --- a/kotlin-native/runtime/src/main/cpp/Natives.cpp +++ b/kotlin-native/runtime/src/main/cpp/Natives.cpp @@ -36,11 +36,6 @@ using namespace kotlin; extern "C" { -// Any.kt -KBoolean Kotlin_Any_equals(KConstRef thiz, KConstRef other) { - return thiz == other; -} - KInt Kotlin_Any_hashCode(KConstRef thiz) { // NOTE: `Any?.identityHashCode()` is used in Blackhole implementations of both kotlinx-benchmark and // K/N's own benchmarks. These usages rely on this being an intrinsic property of the object. diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/Any.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/Any.kt index 94c1568b163..a3791ee21c5 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/Any.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/Any.kt @@ -28,8 +28,7 @@ public open class Any { * * Read more about [equality](https://kotlinlang.org/docs/reference/equality.html) in Kotlin. */ - @GCUnsafeCall("Kotlin_Any_equals") - external public open operator fun equals(other: Any?): Boolean + public open operator fun equals(other: Any?): Boolean = this === other /** * Returns a hash code value for the object. The general contract of `hashCode` is: