✗
Failing This test is currently failing.
Failed: must-fail-passed
Failure Output
📋 prototype gaps — event 'greet' (/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/400_167_prototype_scope_must_not_leak_across_modules/helper.kz:17):
hole — 'err' unhandled → @panic if reached
🎯 Compiler coordination: Passes: 17 (flow-based: frontend, analysis, emission) Code
// PINS: ~[prototype] must be scoped to the module that bears the annotation.
// It is a per-file opt-in (concepts/frag-prototype-mode-panic-holes.md) — a
// module that does NOT carry the annotation must keep full exhaustiveness even
// when some OTHER module in the program is a prototype.
//
// This main module IS ~[prototype], and imports app/helper — a plain,
// non-prototype module. helper.kz contains an incomplete flow (a declared
// terminal left unhandled). Because helper is not a prototype, that hole must
// be rejected KORU022, exactly as it is when no module in the program is a
// prototype at all.
//
// The annotation lives on a single program-level field (ast.Program
// .module_annotations), so today the leniency it grants is program-WIDE: the
// prototype flag flips exhaustiveness for helper's flow too, and the hole is
// silently tolerated instead of rejected. This test pins that leak — it stays
// MUST_FAIL-passed (no KORU022) until prototype scope is made per-module.
~[prototype]
~import app/helper
Must fail at runtime:
Program must error when executed.
Error Verification
Actual Compiler Output
📋 prototype gaps — event 'greet' (/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/400_167_prototype_scope_must_not_leak_across_modules/helper.kz:17):
hole — 'err' unhandled → @panic if reached
🎯 Compiler coordination: Passes: 17 (flow-based: frontend, analysis, emission)Imported Files
// A plain, non-prototype module (app/helper). Its own flow leaves the declared
// terminal `| err` unhandled — a hole. Since this module carries no ~[prototype]
// annotation, that hole must be rejected KORU022 regardless of what any other
// module in the program is annotated with. See input.kz for what this pins.
~import std/io
~pub event greet { name: []const u8 }
| ok []const u8
| err []const u8
~proc greet|zig {
_ = name;
return .{ .ok = "hi from helper" };
}
~greet(name: "internal")
| ok msg |> std/io:print.ln(msg)
Test Configuration
MUST_FAIL
Expected Error:
KORU022