is this a intended behavior of .withDefault? It ap...
# announcements
a
is this a intended behavior of .withDefault? It appears the only case I can actually get the default is by using .getValue
a
yes, as stated in the documentation
This implicit default value is used when the original map doesn't contain a value for the key specified and a value is obtained with Map.getValue function, for example when properties are delegated to the map.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/with-default.html
a
Is there any impairment to enable
.withDefault
for other Map methods?
a
It would violate the
Map
-Interface-Contract, https://youtrack.jetbrains.com/issue/KT-11851
a
Thanks a lot