From 4b9d136cedb27cf53462c08d0a7efa0c926adfd7 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 25 Sep 2015 19:44:04 +0300 Subject: [PATCH] identityEquals is deprecated --- compiler/testData/builtin-classes.txt | 2 +- .../tests/thisAndSuper/superInExtensionFunctionCall.kt | 2 +- core/builtins/native/kotlin/Library.kt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 5adea951ca6..8b775707d69 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1,7 +1,7 @@ package-fragment kotlin public fun arrayOfNulls(/*0*/ size: kotlin.Int): kotlin.Array -public fun kotlin.Any?.identityEquals(/*0*/ other: kotlin.Any?): kotlin.Boolean +@kotlin.Deprecated(replaceWith = kotlin.ReplaceWith(expression = "this === other", imports = {}), value = "This function is deprecated, use === instead") public fun kotlin.Any?.identityEquals(/*0*/ other: kotlin.Any?): kotlin.Boolean public operator fun kotlin.String?.plus(/*0*/ other: kotlin.Any?): kotlin.String public fun kotlin.Any?.toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/superInExtensionFunctionCall.kt b/compiler/testData/diagnostics/tests/thisAndSuper/superInExtensionFunctionCall.kt index 167cf9d3491..57fc070a77f 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/superInExtensionFunctionCall.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/superInExtensionFunctionCall.kt @@ -1,6 +1,6 @@ // No supertype at all class A1 { fun test() { - super.identityEquals(null) // Call to an extension function + super.identityEquals(null) // Call to an extension function } } \ No newline at end of file diff --git a/core/builtins/native/kotlin/Library.kt b/core/builtins/native/kotlin/Library.kt index 5a8391722f9..d95bc049557 100644 --- a/core/builtins/native/kotlin/Library.kt +++ b/core/builtins/native/kotlin/Library.kt @@ -20,6 +20,7 @@ package kotlin * Returns true if the receiver and the [other] object are the same object instance, or if they * are both null. */ +@Deprecated("This function is deprecated, use === instead", ReplaceWith("this === other")) public fun Any?.identityEquals(other: Any?): Boolean // = this === other /**