ShootingStar
03/23/2021, 5:40 PMRestricted suspending functions can only invoke member or extension suspending functions on their restricted coroutine scope
Can I get some advice?
@RestrictsSuspension
abstract class Service() {
protected suspend inline fun yieldAsync() { ... }
protected abstract suspend fun start()
private suspend fun startWrapper() {
yieldAsync()
start()
}
private fun <T> launchCoroutine(block: suspend () -> T) = block.startCoroutine(...)
final override fun onLifecycleStart() {
launchCoroutine { startWrapper() } // <- error spot startWrapper()
}
}
nanodeath
03/23/2021, 5:51 PM