Dominaezzz
01/29/2020, 2:04 AMval works = DetachedObjectGraph(TransferMode.SAFE) {
mutableMapOf<String, String>()
}
var result: Result<String>? = null
val breaks = DetachedObjectGraph(TransferMode.SAFE) {
val map = works.attach()
result = runCatching { map.keys.first() } // This here.... what's wrong?
println(result) // Failure(kotlin.NoSuchElementException: Collection is empty.)
map
}
// kotlin.IllegalStateException: Illegal transfer state.
println(breaks.attach()) // Doesn't get here
println(result)