✓
Passing This code compiles and runs correctly.
Code
// Phase 3 captured failing test: when .k exists, the sibling .kz cannot
// also declare ~pub event. Today both declarations land (the registry
// silently drops the duplicate); this test pins KORU111 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 public event in implementation fileError Verification
Actual Compiler Output
error[KORU111]: public event in implementation file '/Users/larsde/src/koru/tests/regression/100_MODULE_SYSTEM/140_FILE_LAYOUT/140_007_reject_pub_event_in_impl_when_k_exists/contract.kz' when a .k contract companion exists in the same module
--> tests/regression/100_MODULE_SYSTEM/140_FILE_LAYOUT/140_007_reject_pub_event_in_impl_when_k_exists/input.kz:8:0
|
8 | ~import "$std/io"
| ^
hint: public event declarations belong in the .k contract — move this ~pub event to the sibling .k file, or drop ~pub if it is internal scaffoldingImported Files
// Phase 3 rule 2: when contract.k exists, this companion .kz file
// cannot also declare ~pub event. Implementation files own the procs;
// the public surface lives in .k only.
const std = @import("std");
~pub event compute { x: u32 }
| done u32
~proc compute|zig {
return .{ .done = x + 100 };
}
Test Configuration
MUST_FAIL