Javier
03/05/2020, 10:16 PMstreetsofboston
03/05/2020, 10:21 PMfun () -> T
is not the same as fun suspend() -> T
nor vice versa…..
Instead of the unused suspend
of your populateTextView
, do this instead:
lifecycleScope.launch {
viewModel.users.collect {
populateTextView(it)
}
}
Javier
03/05/2020, 10:23 PMstreetsofboston
03/05/2020, 10:23 PMfun A.(B) -> C
would be assignable to a suspend fun A.(B) -> C
…. but that is not the case…..suspend fun A.(B) -> C
translates to a fun A.(B, Continuation<C>) -> Any
…. and that is not compatible with `fun A.(B) -> C`…. But it could be solved with some syntactic sugar 😄Javier
03/05/2020, 10:24 PMstreetsofboston
03/05/2020, 10:58 PMcollect
where the diff of its parameter is only a missing suspend
keyword? What happens if you’d rename populate
to collect
?octylFractal
03/05/2020, 11:15 PMstreetsofboston
03/05/2020, 11:27 PMJavier
03/06/2020, 8:56 AMelizarov
03/06/2020, 10:07 AM