Allow delegating val properties to out-projected MutableMap

Change generic signature of MutableMap.getValue, use 'out @Exact V' and `V1: V` types instead of single `in V`.
Fix affected IR generation tests.

#KT-18789 Fixed
This commit is contained in:
Ilya Gorbunov
2017-07-01 17:00:16 +03:00
parent e503c1d411
commit 7efaa7cabc
6 changed files with 18 additions and 7 deletions
@@ -26,8 +26,8 @@ public inline operator fun <V, V1: V> Map<in String, @Exact V>.getValue(thisRef:
*/
@kotlin.jvm.JvmName("getVar")
@kotlin.internal.InlineOnly
public inline operator fun <V> MutableMap<in String, in V>.getValue(thisRef: Any?, property: KProperty<*>): V
= @Suppress("UNCHECKED_CAST") (getOrImplicitDefault(property.name) as V)
public inline operator fun <V, V1: V> MutableMap<in String, out @Exact V>.getValue(thisRef: Any?, property: KProperty<*>): V1
= @Suppress("UNCHECKED_CAST") (getOrImplicitDefault(property.name) as V1)
/**
* Stores the value of the property for the given object in this mutable map.