✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:45:9: error: expected type 'bool', found 'fn (i64) i64'
Failure Output
Showing last 10 of 14 lines
referenced by:
flow0: output_emitted.zig:61:57
main: output_emitted.zig:518:22
4 reference(s) hidden; use '-freference-trace=6' to see all references
output_emitted.zig:59:28: error: function with non-void return type 'i64' implicitly returns
fn ask(_: i64) i64 {}
^~~
output_emitted.zig:59:33: note: control flow reaches end of body here
fn ask(_: i64) i64 {}
^ Code
// OPTIONAL RESUME ARMS, the presence test (`if(ask)`) — designed 2026-07-03.
// An arm that RESUMES a value (`! ?ask i64 -> i64`) cannot lower to a no-op
// when unhandled (there is no value to fabricate), so the producer must be
// able to DECIDE whether to fire: inside the declaring event's impl, the
// arm's bare name in `if`'s condition position is a comptime PRESENCE test —
// "did this consumer install the handler." Same `if(...) | then | else`
// construct as 010_008; the only novelty is the condition's expression kind.
// Inside `| then` the arm is fireable exactly like a required arm (the
// bind-then-construct body is 400_132's shape); in `| else` the producer
// writes its own fallback — explicitly, no silent default.
//
// This consumer OMITS the handler, so the comptime branch resolves to
// `| else` and the program prints 0. The handled twin behaves like 400_132.
import std/io
pub event query { q: i64 }
! ?ask i64 -> i64
| done i64
query = if(ask)
| then |> ask(q): a => done a
| else => done 0
query(q: 41)
| done r |> std/io:print.ln("{{ r:d }}")
Expected output
0
Flows
subflow ~query click a branch to expand · @labels scroll to their anchor
if (ask)
flow ~query click a branch to expand · @labels scroll to their anchor
query (q: 41)
Test Configuration
MUST_RUN