✓
Passing This code compiles and runs correctly.
Code
// Contract: the public events live here, in the pure .k facet. The entry
// being compiled is input.kz, but `koruc input.kz` must merge THIS sibling
// (same stem `input`) so these events are in scope for the flow + procs.
pub event compute { x: u32 }
| done u32
pub event show { v: u32 }
Actual
142
Expected output
✓ Zig✓ JavaScript142
Emitted JavaScript source
// JavaScript implementation facet. Unused on the Zig target (the harness only
// emits Zig), but it must coexist in the merged module without breaking it —
// its |js procs attach to the same events as the |zig variants.
const main_module = {
compute_event: {
handler(input) {
const x = input.x;
return { tag: "done", done: x + 100 };
},
},
show_event: {
handler(input) {
const v = input.v;
console.log(v);
},
},
flow0() {
const result_0 = main_module.compute_event.handler({ x: 42 });
const r = result_0.done;
{
const v = r;
console.log(v);
}
},
};
main_module.flow0();
Test Configuration
MUST_RUN