Make MutableMap.set return Unit
#KT-7853 Fixed
This commit is contained in:
@@ -14,7 +14,13 @@ import java.util.concurrent.ConcurrentMap
|
|||||||
* Allows to use the index operator for storing values in a mutable map.
|
* Allows to use the index operator for storing values in a mutable map.
|
||||||
*/
|
*/
|
||||||
// this code is JVM-specific, because JS has native set function
|
// this code is JVM-specific, because JS has native set function
|
||||||
public operator fun <K, V> MutableMap<K, V>.set(key: K, value: V): V? = put(key, value)
|
public operator fun <K, V> MutableMap<K, V>.set(key: K, value: V): Unit {
|
||||||
|
put(key, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated("Provided for binary compatibility", level = DeprecationLevel.HIDDEN)
|
||||||
|
@JvmName("set")
|
||||||
|
public fun <K, V> MutableMap<K, V>.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.
|
* getOrPut is not supported on [ConcurrentMap] since it cannot be implemented correctly in terms of concurrency.
|
||||||
|
|||||||
Reference in New Issue
Block a user