Hello, I can’t compile the following code with Kot...
# announcements
s
Hello, I can’t compile the following code with Kotlin 1.2.71. However, the code compiled well with Kotlin 1.2.30 even though the same error message shows in my IntelliJ (with red underline).
Restricted suspending functions can only invoke member or extension suspending functions on their restricted coroutine scope
Can I get some advice?
Copy code
@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()
    }
}
n
this seems kinda esoteric, you might have better luck on #C1CFAFJSK