Michael de Kaste
08/02/2022, 6:29 PMLandry Norris
08/02/2022, 6:30 PMyield
is a suspend function, so it can only be called within a suspend function or other coroutine context. inner
is not marked as suspend, so it can’t call suspend functions.Michael de Kaste
08/02/2022, 6:32 PMLandry Norris
08/02/2022, 6:35 PMyield
, however, since it is a suspend function. You can use launch or runBlocking if you have to use it, depending on what you want to do.Landry Norris
08/02/2022, 6:35 PMLandry Norris
08/02/2022, 6:36 PMsuspend fun inner() {
yield(3)
}
ephemient
08/02/2022, 6:36 PMsuspend fun SequenceScope<Int>.inner()
Michael de Kaste
08/02/2022, 6:37 PM