✓
Passing This code compiles and runs correctly.
Code
// Bare-return produce (`-> e`) in a `#L`/`@L` label-fold LOOP-EXIT arm.
//
// A `#L` loop's terminal arm satisfies the enclosing event's bare return by
// producing a value with `->` — exactly like a non-loop handler arm (020_025,
// `| big b -> b * 100`), just on the label-fold emission path instead of the
// subflow/switch path. `run` is declared `-> i64`; the loop sums 5+4+3+2+1 and
// the `| done e -> e` exit arm produces the total.
//
// PINNED FAILING (2026-06-29): the label-fold loop lowers the exit arm as
// `const e = result.done; _ = e;` (a discard) instead of `return e;`, so the
// i64-returning handler falls off its end. Sibling gap to 020_025 on the loop
// path — the bare-return signal never reaches emitFlow's loop-exit emission.
~import std/io
~event step { n: i64, acc: i64 }
| more { n: i64, acc: i64 }
| done i64
~event run { start: i64 } -> i64
~step = if(n > 0)
| then => more { n: n - 1, acc: acc + n }
| else => done acc
~run = #L step(n: start, acc: 0)
| more s |> @L(s.n, s.acc)
| done e -> e
~run(start: 5): r |> std/io:print.ln("{{ r:d }}")
Actual
15
Expected output
15
Flows
subflow ~step click a branch to expand · @labels scroll to their anchor
if (n > 0)
subflow ~run click a branch to expand · @labels scroll to their anchor
#L step (n: start, acc: 0)
flow ~run click a branch to expand · @labels scroll to their anchor
run (start: 5)
Test Configuration
MUST_RUN