Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinsuspend compiled to state machineSingle-choice MCQ

In the generated state machine, the function re-enters through a single `label`/`switch` dispatch. What does the first action of the resumed method do with the incoming result, and what subtle bug pattern does the `label` guard prevent?

// pseudo-decompiled int label = $continuation.label; switch (label) { case 0: ...; this.L$0 = a; this.label = 1; if (step1(this) == SUSPENDED) return SUSPENDED; case 1: a = (A) this.L$0; result = $result; ... }