get Or Put Nullable
Solves the nullability bug of MutableMap.getOrPut.
Usage example:
var map = mutableMapOf("a" to null, "b" to 1)
map.getOrPut("a"){ 2 } // 2
map // {a=2, b=1}
map = mutableMapOf("a" to null, "b" to 1)
map.getOrPutNullable("a"){ 2 } // null
map // {a=null, b=1}
Content copied to clipboard