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

Within `suspendCoroutine { cont -> ... }`, the lambda invokes `cont.resume(x)` synchronously before the block returns. What value does the surrounding suspend machinery observe, and does the coroutine actually suspend?

suspend fun trick(): Int = suspendCoroutine { cont -> cont.resume(99) // called synchronously, inline }