hfhbd
04/13/2022, 10:35 AMAmbiguous coroutineContext due to CoroutineScope receiver of suspend function
, because CoroutineScope.coroutineContext
and coroutineContext
. But why does coroutines-core itself use this construct? https://github.com/Kotlin/kotlinx.coroutines/blob/52cbf01c63c0737ee745ff08568f26385271a9ab/kotlinx-coroutines-core/common/src/Builders.common.kt#L50ephemient
04/13/2022, 11:36 AMhfhbd
04/13/2022, 11:37 AMephemient
04/13/2022, 11:39 AMhfhbd
04/13/2022, 11:40 AMcoroutineContext
from the suspend lambda and, according to the hint, you should use coroutineScope
insteadephemient
04/13/2022, 11:44 AMhfhbd
04/13/2022, 11:55 AMsuspend CoroutineScope.() -> Unit
lambda, but is not safe to use suspend fun CoroutineScope.foo()
and does not result into shadowing coroutineContext
?