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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user