From a8b11ff07b47e8fef726029457d25ceeefaf43b8 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Mon, 9 Nov 2015 21:58:27 +0300 Subject: [PATCH] Make MutableMap.set return Unit #KT-7853 Fixed --- libraries/stdlib/src/kotlin/collections/MapsJVM.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/stdlib/src/kotlin/collections/MapsJVM.kt b/libraries/stdlib/src/kotlin/collections/MapsJVM.kt index a51d87ebfe3..d05e8e74507 100644 --- a/libraries/stdlib/src/kotlin/collections/MapsJVM.kt +++ b/libraries/stdlib/src/kotlin/collections/MapsJVM.kt @@ -14,7 +14,13 @@ import java.util.concurrent.ConcurrentMap * Allows to use the index operator for storing values in a mutable map. */ // this code is JVM-specific, because JS has native set function -public operator fun MutableMap.set(key: K, value: V): V? = put(key, value) +public operator fun MutableMap.set(key: K, value: V): Unit { + put(key, value) +} + +@Deprecated("Provided for binary compatibility", level = DeprecationLevel.HIDDEN) +@JvmName("set") +public fun MutableMap.set(key: K, value: V): V? = put(key, value) /** * getOrPut is not supported on [ConcurrentMap] since it cannot be implemented correctly in terms of concurrency.