diff --git a/libraries/stdlib/src/kotlin/Maps.kt b/libraries/stdlib/src/kotlin/Maps.kt index 7c4e78c516f..c39f084d252 100644 --- a/libraries/stdlib/src/kotlin/Maps.kt +++ b/libraries/stdlib/src/kotlin/Maps.kt @@ -46,7 +46,7 @@ fun Map.Entry.component2() : V { */ public inline fun Map.getOrElse(key: K, defaultValue: ()-> V) : V { if (this.containsKey(key)) { - return this.get(key) + return this.get(key) as V } else { return defaultValue() } @@ -59,7 +59,7 @@ public inline fun Map.getOrElse(key: K, defaultValue: ()-> V) : V { */ public inline fun MutableMap.getOrPut(key: K, defaultValue: ()-> V) : V { if (this.containsKey(key)) { - return this.get(key) + return this.get(key) as V } else { val answer = defaultValue() this.put(key, answer)