✓
Passing This code compiles and runs correctly.
Code
// Test: effect-branch handler produces a resume value with the `->` glyph.
//
// Producer declares `! ask []const u8 -> []const u8` (yield a question,
// resume with a reply) and uses the reply. The effect is declared `-> T`
// (single payload, no branches), so the arm PRODUCES its resume value with
// `->`, the function-like produce glyph: `! ask _ -> "Alice"`. Not `|>`
// (which only chains a step) and not `=>` (which constructs a branch — there
// are none here). The glyph is fixed by the declaration.
~import std/io
const std = @import("std");
~pub event prompt-user { question: []const u8 }
! ask []const u8 -> []const u8
| done []const u8
~proc prompt-user|zig {
const reply = ask(question);
return .{ .done = reply };
}
~prompt-user(question: "What's your name?")
! ask _ -> "Alice"
| done r |> std/io:print.blk {
reply was: {{ r:s }}
}
Actual
reply was: Alice
Expected output
reply was: Alice
Flows
flow ~prompt-user click a branch to expand · @labels scroll to their anchor
prompt-user (question: "What's your name?")
Test Configuration
MUST_RUN