✓
Passing This code compiles and runs correctly.
Code
// PIN (2026-07-03): the COMPOSITION of the two session emitter fixes — mutual
// tail-recursion flattening (emitter/mutual-tail-flatten) AND simultaneous
// (snapshot) reentry-arg assignment (emitter/tail-loop-parallel-assign). Neither
// branch handled this alone: ping/pong are a mutual-tail cycle (needs the
// combined dispatch loop) whose reargs cross-reference (a: b, b: a — needs the
// staged/simultaneous assignment, shared via emitTailReargs). Two mutual swaps of
// (1,2) return `a` to 1; a sequential rearg would corrupt the swap and yield 2.
import std/io
pub tor ping { a: i64, b: i64, n: i64 } -> i64
pub tor pong { a: i64, b: i64, n: i64 } -> i64
ping = if(n == 0)
| then -> a
| else |> pong(a: b, b: a, n: n - 1): v -> v
pong = if(n == 0)
| then -> b
| else |> ping(a: b, b: a, n: n - 1): v -> v
ping(a: 1, b: 2, n: 2): r |> std/io:print.ln("{{ r:d }}")
Actual
1
Expected output
1Flows
subflow ~ping click a branch to expand · @labels scroll to their anchor
if (n == 0)
subflow ~pong click a branch to expand · @labels scroll to their anchor
if (n == 0)
flow ~ping click a branch to expand · @labels scroll to their anchor
ping (a: 1, b: 2, n: 2)
Test Configuration
MUST_RUN