fun valuesNotNull(map: MutableMap) { map.merge(1, "x") { old, new -> old + new } // SUCCESS // ORIGINAL: fun merge(K, V, (V, V) -> V?): V? defined in kotlin.collections.MutableMap // SUBSTITUTED: fun merge(Int, String, (String, String) -> String?): String? defined in kotlin.collections.MutableMap } fun valuesNullable(map: MutableMap) { map.merge(1, "x") { old, new -> old + new } // SUCCESS // ORIGINAL: fun merge(K, V, (V, V) -> V?): V? defined in kotlin.collections.MutableMap // SUBSTITUTED: fun merge(Int, String, (String, String) -> String?): String? defined in kotlin.collections.MutableMap map.merge(1, null) { old, new -> old + new } // NULLABLE_ARGUMENT_TYPE_MISMATCH // ORIGINAL: fun merge(K, V, (V, V) -> V?): V? defined in kotlin.collections.MutableMap // SUBSTITUTED: fun merge(Int, String, (String, String) -> String?): String? defined in kotlin.collections.MutableMap } fun valuesT(map: MutableMap, newValue: T) { map.merge(1, newValue) { old, new -> null } // SUCCESS // ORIGINAL: fun merge(K, V, (V, V) -> V?): V? defined in kotlin.collections.MutableMap // SUBSTITUTED: fun merge(Int, T, (T, T) -> T?): T? defined in kotlin.collections.MutableMap } fun valuesTNotNull(map: MutableMap, newValue: T) { map.merge(1, newValue) { old, new -> null } // SUCCESS // ORIGINAL: fun merge(K, V, (V, V) -> V?): V? defined in kotlin.collections.MutableMap // SUBSTITUTED: fun merge(Int, T, (T, T) -> T?): T? defined in kotlin.collections.MutableMap } fun valuesTNullable(map: MutableMap, newValue: T?) { map.merge(1, newValue) { old, new -> new } // NULLABLE_ARGUMENT_TYPE_MISMATCH // ORIGINAL: fun merge(K, V, (V, V) -> V?): V? defined in kotlin.collections.MutableMap // SUBSTITUTED: fun merge(Int, T, (T, T) -> T?): T? defined in kotlin.collections.MutableMap map.merge(1, newValue!!) { old, new -> new } // SUCCESS // ORIGINAL: fun merge(K, V, (V, V) -> V?): V? defined in kotlin.collections.MutableMap // SUBSTITUTED: fun merge(Int, T, (T, T) -> T?): T? defined in kotlin.collections.MutableMap }