✓
Passing This code compiles and runs correctly.
Code
// INVALID SHAPE: `=>` constructs a branch of the event, and a `_` discard is
// not a constructor operand — `| ok _ => err _` re-raises with a discarded
// payload. Refused at parse ("cannot construct a branch from a discard");
// previously the emitted `_` died in Zig ("'_' used as an identifier") with
// no Koru diagnostic.
~import std/io
const std = @import("std");
~pub tor stage { }
| ok string
| err string
~proc stage|zig { return .{ .ok = "hi" }; }
~stage()
| ok _ => err _
| err e |> std/io:print.ln("err: {{ e:s }}")
Frontend must reject with:
CONTAINS PARSE003
CONTAINS cannot construct a branch from a discard