Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinCOROUTINE_SUSPENDED sentinelSingle-choice MCQ

Consider a suspend function that sometimes completes without suspending. What determines, at runtime, whether the function returns its value directly versus the `COROUTINE_SUSPENDED` sentinel?

suspend fun maybe(): Int { return if (ready()) 42 // path A else awaitSomething() // path B, calls a suspending op }