✓
Passing This code compiles and runs correctly.
Code
// INVALID SHAPE by design: `=>` returns one of the EVENT's branches, and a
// void event like void-sink has no branches to return — the shape can never
// be satisfied. The valid consumer is the continuation: `| ok _ |>
// void-sink()`.
//
// Refused at parse with the same single-identifier rule the braced path
// enforces: a call-shaped RHS cannot ride along as a "payloadless constructor
// named 'void-sink()'". Previously the shape fell through to the emitted Zig
// ("expected ',' after initializer") with no Koru diagnostic.
~import std/io
const std = @import("std");
~pub tor stage { }
| ok string
| err string
~proc stage|zig { return .{ .ok = "hi" }; }
~pub tor void-sink { }
~proc void-sink|zig { std.debug.print("sink\n", .{}); }
~stage()
| ok _ => void-sink()
| err e |> std/io:print.ln("err: {{ e:s }}")
Frontend must reject with:
CONTAINS PARSE003
CONTAINS invalid branch constructor