Mohit Khanna
07/01/2021, 1:54 AMoverride val entries: MutableSet<MutableMap.MutableEntry<K, V>>
get() {
throw UnsupportedOperationException("Can't leak mutable reference")
// access { IsoMutableSet(fork(it.entries)) }
}
Thanks!kpgalligan
07/01/2021, 4:45 PMkpgalligan
07/01/2021, 4:58 PMMutableMap.MutableEntry retains a reference to it's parent. Stepping through that would likely try to return an instance of MutableMap.MutableEntry across threads, which will crash. To properly implement entries, we'd need to wrap the MutableSet<MutableMap.MutableEntry<K, V>> result