✓
Passing This code compiles and runs correctly.
Code
// Phase 3 captured failing test: private event in .k must be rejected
// with KORU111. Today the compiler accepts it silently; this test pins
// the violation until the validator pass lands.
const std = @import("std");
~import "$std/io"
~import "$app/contract"
~app.contract:compute(x: 42)
| done v |> std.io:print.ln("{{ v:d }}")
Frontend must reject with:
CONTAINS KORU111
CONTAINS private event in contract fileError Verification
Actual Compiler Output
error[KORU111]: private event in contract file '/Users/larsde/src/koru/tests/regression/100_MODULE_SYSTEM/140_FILE_LAYOUT/140_006_reject_private_event_in_contract/contract.k'
--> tests/regression/100_MODULE_SYSTEM/140_FILE_LAYOUT/140_006_reject_private_event_in_contract/input.kz:7:0
|
7 | ~import "$std/io"
| ^
hint: events declared in a .k contract file must be ~pub; either add ~pub or move this declaration to a non-.k implementation fileImported Files
const std = @import("std");
~proc compute|zig {
return .{ .done = x + 100 };
}
Test Configuration
MUST_FAIL