From 92de137cd6bbb5907196a60f8cd46c54d5f525ab Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Tue, 11 Jul 2023 15:02:42 +0300 Subject: [PATCH] Deprecate HashSet.getElement() and document that it's for ObjC interop. Will become HIDDEN eventually. As a part of efforts to stabilize Native #KT-55765. --- .../stdlib/native-wasm/src/kotlin/collections/HashSet.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/stdlib/native-wasm/src/kotlin/collections/HashSet.kt b/libraries/stdlib/native-wasm/src/kotlin/collections/HashSet.kt index fe6aff55d02..4ce80562d71 100644 --- a/libraries/stdlib/native-wasm/src/kotlin/collections/HashSet.kt +++ b/libraries/stdlib/native-wasm/src/kotlin/collections/HashSet.kt @@ -63,6 +63,10 @@ actual class HashSet internal constructor( override actual val size: Int get() = backing.size override actual fun isEmpty(): Boolean = backing.isEmpty() override actual fun contains(element: E): Boolean = backing.containsKey(element) + + /** Implements KonanSet.getElement(). Used for ObjC interop. */ + @Deprecated("This function is not supposed to be used directly.") + @DeprecatedSinceKotlin(warningSince = "1.9") // TODO: advance to HIDDEN eventually override fun getElement(element: E): E? = backing.getKey(element) override actual fun clear() = backing.clear() override actual fun add(element: E): Boolean = backing.addKey(element) >= 0