✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test 210_130: MUST_ERROR — --panic-branches=strict makes unhandled panic
// branches compile errors (the crash-surface map).
//
// Panic branches are ignorable by default (210_127: unhandled | ?!oom
// compiles, synthesizing a @panic arm). The --panic-branches=strict flag
// flips the dev/production behavior: every UNHANDLED panic branch becomes a
// compile error (KORU022) listing where the program can crash on a rare
// failure. Same source — the flag flips it. Dev = silent auto-panic
// (ergonomic); production/audit = handle each or explicitly mute.
//
// This is "see where you're ignoring your panics" as a compiler pass: run
// with the flag, compilation fails enumerating every ignored panic branch.
//
// Expected: backend fails with KORU022 naming the unhandled panic branch
// 'oom' and pointing at the flow. (Same input compiles WITHOUT the flag —
// see 210_127.)
~pub tor alloc { n: usize }
| success []u8
| ?!oom usize
~proc alloc|zig {
return .{ .success = &.{} };
}
~alloc(n: 4)
| success _ |> _
// NO `| oom _ |> _` handler — strict mode rejects this.
Actual compiler output
error[KORU022]: panic branch 'oom' is unhandled — in strict mode (--panic-branches=strict) panic branches must be handled or explicitly muted (| oom _ |> ...). Without strict mode this synthesizes @panic at runtime.
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_130_panic_branch_strict_flag/input.kz:26:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime:
Program must error when executed.
Expected patterns
Each line is a regex that must match the compiler error output.
KORU022.*panic branch 'oom' is unhandledFlows
flow ~alloc click a branch to expand · @labels scroll to their anchor
alloc (n: 4)
Test Configuration
MUST_ERROR
Compiler Flags:
--panic-branches=strict