Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlincoroutine cancellation cooperationSingle-choice MCQ

Code in a `finally` block after cancellation needs to call another suspend function (e.g., to close a resource). Why does the suspend call throw immediately, and what is the correct internals-aware fix?

launch { try { work() } finally { delay(100) // suspend in finally, after cancellation } }