Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinthe Continuation interfaceSingle-choice MCQ

The `Continuation<T>` interface exposes `resumeWith(result: Result<T>)`. Why does the compiled coroutine machinery pass a `Result<T>` (a success-or-failure union) into `resumeWith` rather than separately resuming with a value or an exception?

public interface Continuation<in T> { val context: CoroutineContext fun resumeWith(result: Result<T>) }