✓
Passing This code compiles and runs correctly.
Code
// Negative test: consumer must handle every non-optional terminal of an
// event. The `?` modifier on a terminal (`| ?done`) marks it as optional
// — consumer may omit; the compiler synthesizes a no-op switch arm. Without
// the `?`, the terminal is required, and omitting the handler must error.
//
// The event below declares `| done` (required) and `| err []const u8`
// (required). The consumer's flow handles `| err` but NOT `| done`. The
// compiler must reject this — silent auto-synthesis of the missing arm
// would mean `?` carries no meaning and the language has no way to
// distinguish "optional terminal" from "you forgot a handler".
~import std/io
~pub tor run {}
| done
| err string
~proc run|zig {
return .{ .done = .{} };
}
~run()
| err msg |> std/io:print.ln(msg)
Must fail at runtime:
Program must error when executed.
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
Expected Error:
KORU022