domfox
04/24/2018, 7:07 AMbind
being defined as an extension method on Any
locally within the block?domfox
04/24/2018, 7:08 AMjereksel
04/24/2018, 7:09 AMdomfox
04/24/2018, 7:15 AMkotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
suggests some entanglement in internal implementation, but perhaps it's harmless.domfox
04/24/2018, 7:26 AMjereksel
04/24/2018, 7:27 AMjereksel
04/24/2018, 7:27 AMjereksel
04/24/2018, 9:03 AMjereksel
04/24/2018, 9:03 AMpackage com.example.domain
val networkResult: NetworkResult = HttpError("boom!")
val f: (String) -> String = String::toUpperCase
when (networkResult) {
is HttpError -> networkResult.copy(f(networkResult.message))
else -> networkResult
}
//null
jereksel
04/24/2018, 9:04 AMwhen
doesn't return value - it always returns nullpakoito
04/24/2018, 9:50 AMpakoito
04/24/2018, 9:51 AMpakoito
04/24/2018, 9:51 AMpakoito
04/24/2018, 9:52 AMpakoito
04/24/2018, 9:53 AMkotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDEDThat’s the expected usage of the API. All the machinery is marked “experimental” even after 3 minor versions of the language since they were released.
pakoito
04/24/2018, 9:54 AMpakoito
04/24/2018, 9:55 AMpakoito
04/24/2018, 9:56 AMpakoito
04/24/2018, 9:56 AMpakoito
04/24/2018, 9:59 AMdomfox
04/24/2018, 10:11 AMpakoito
04/24/2018, 10:24 AMpakoito
04/24/2018, 10:24 AMdomfox
04/24/2018, 10:30 AMpakoito
04/24/2018, 1:44 PMpakoito
04/24/2018, 1:44 PMdomfox
04/24/2018, 3:05 PMpakoito
04/24/2018, 8:31 PMpakoito
04/24/2018, 8:31 PMEither.binding(CommonPool) { ... }
that executed the code in the common pool and blocked the current thread for a response