✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:99:38: error: expected 2 argument(s), found 1
Failure Output
Showing last 10 of 11 lines
Error: output_emitted.zig:99:38: error: expected 2 argument(s), found 1
var result_0 = main_module.step_event.handler(.{ .n = loop_n });
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
output_emitted.zig:74:13: note: function declared here
pub fn handler(__koru_event_input: Input, comptime __H: type) Output {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
flow0: output_emitted.zig:127:49
main: output_emitted.zig:782:22
4 reference(s) hidden; use '-freference-trace=6' to see all references Code
// PINS: a fold preceded by a prefix bind must still thread the effect-branch
// Handlers type into the folded event.
//
// An event carrying `!` arms compiles to a handler taking TWO parameters —
// the input and the comptime Handlers type that holds the arm bodies:
//
// pub fn handler(__koru_event_input: Input, comptime __H: type) Output
//
// With a prefix ahead of the fold head, both the fold's seed call and its
// back-edge re-invocation are emitted with the input alone, and the arity
// mismatch surfaces as a raw Zig error naming a `__H` the author never wrote.
//
// The isolation, one variable at a time:
// `#loop step(n: 0)` + effect arms — composes
// two effect arms, no prefix — composes
// `seed(): n0 |> #loop step(n: n0)` + effect arms — this pin
//
// So the fault is the prefix position, the same one 210_166 holds, and a
// DIFFERENT fault there: 210_166 is the exit arm's capture, this is Handlers
// threading. Two defects living at one syntactic position, which is why each
// gets its own pin rather than one test varying both.
//
// Why it matters beyond the grammar: this shape IS a blocking `await` — pump a
// pending operation in a fold, firing progress/completion arms each round,
// until it drains. The non-fold spelling of the same design already composes.
~import std/io
~tor seed {} -> i32
~proc seed|zig { return 0; }
~tor step { n: i32 }
! tick i32
| again i32
| stop i32
~proc step|zig {
tick(n);
if (n < 3) return .{ .again = n + 1 };
return .{ .stop = n };
}
~tor spin {} -> i32
~spin = seed(): n0 |> #loop step(n: n0)
! tick t |> std/io:print.ln(" tick {{ t:d }}")
| again v |> @loop(n: v)
| stop r -> r
~spin(): f |> std/io:print.ln("done {{ f:d }}")
Expected output
tick 0
tick 1
tick 2
tick 3
done 3
Flows
subflow ~spin click a branch to expand · @labels scroll to their anchor
seed
flow ~spin click a branch to expand · @labels scroll to their anchor
spin
Test Configuration
MUST_RUN