Moved MutableMap.set from Maps.kt to MapsJVM.kt to avoid ambiguity when compile MapTest.kt by JS backend.

This commit is contained in:
Zalim Bashorov
2014-06-23 22:04:34 +04:00
committed by Ilya Ryzhenkov
parent 9b081fd254
commit 223a14a855
3 changed files with 7 additions and 5 deletions
@@ -12,9 +12,6 @@ public val Map<*, *>.size: Int
public val Map<*, *>.empty: Boolean
get() = isEmpty()
/** Provides [] access to maps */
public fun <K, V> MutableMap<K, V>.set(key: K, value: V): V? = this.put(key, value)
/** Returns the [[Map]] if its not null otherwise it returns the empty [[Map]] */
public fun <K,V> Map<K,V>?.orEmpty() : Map<K,V>
= if (this != null) this else stdlib_emptyMap()
@@ -8,6 +8,10 @@ import java.util.Properties
// Map APIs
// Move back to Maps.kt after KT-2093 will be fixed
/** Provides [] access to maps */
public fun <K, V> MutableMap<K, V>.set(key: K, value: V): V? = this.put(key, value)
/**
* Converts this [[Map]] to a [[LinkedHashMap]] so future insertion orders are maintained
*/