ikt
06/27/2018, 9:26 AMclass Async_load<WaitT, ErrorT, DoneT> (
val w: WaitT,
f: Async_load<WaitT, ErrorT, DoneT>.(WaitT) -> Unit) {
var state = Async_load_state.Wait<WaitT, ErrorT, DoneT>(w)
init { f(w) }
fun is_done(): Boolean {
return when(state) {
is Async_load_state.Error<*, *, *> -> true
is Async_load_state.Done<*, *, *> -> true
else -> false
}
}
}
Is there a way to simplify this? I do not want to repeat <WaitT, ErrorT, DoneT> all the timegildor
06/27/2018, 9:44 AMikt
06/27/2018, 10:23 PMgildor
06/28/2018, 1:01 AMtypealias AsyncWait = Async_load_state.Wait<WaitT, ErrorT, DoneT>
gildor
06/28/2018, 1:02 AM