I was starting to overcomplate things: ```interfac...
# announcements
k
I was starting to overcomplate things:
Copy code
interface CertainMutableMap<K, V> : MutableMap<K, V> {
    override fun get(key: K): V
}

fun <K, V : Any> MutableMap<K, V>.certainWithDefault(defaultValue: (key: K) -> V): CertainMutableMap<K, V>
        = object : CertainMutableMap<K, V>, MutableMap<K, V> by this {
    override fun get(key: K): V = this@certainWithDefault.getOrElse(key) { defaultValue(key) }
}