✓
Passing This code compiles and runs correctly.
Code
// Pins the wall: importing a comptime-mode module that declares taps must be
// rejected with a koru-level diagnostic. The comptime pipeline does not expand
// transforms (by design — no unbounded recompiles); without the wall the
// tap-flow lowers into backend Zig as a bare event invocation carrying raw
// pattern syntax.
const std = @import("std");
~import app/test_lib/tapmod
~event ping {}
~proc ping|zig {
std.debug.print("ping\n", .{});
}
~ping()
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error Verification
Actual Compiler Output
error[KORU141]: taps are not supported in a ~[comptime] module — the comptime pipeline does not expand transforms (module 'app.test_lib.tapmod')
--> /Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_107_comptime_module_tap_wall/test_lib/tapmod.kz:13:0
|
13 | }
| ^
hint: drop the tap, or remove the module's comptime mode so the tap runs at runtime (see std/profiler)Flows
flow ~ping click a branch to expand · @labels scroll to their anchor
ping
Imported Files
// A ~[comptime|runtime] module carrying a tap — the shape the wall rejects.
~[comptime|runtime]
const std = @import("std");
~import std/taps
~[opaque] event observe { msg: string }
~proc observe|zig {
std.debug.print("[obs] {s}\n", .{msg});
}
~tap(* -> *)
| Profile p |> observe(msg: p.source)
Test Configuration
MUST_FAIL