○
Planned This feature is planned but not yet implemented.
DESIGN: Interceptor feature not yet implemented. Should produce compile error for duplicate interceptors.
Code
// Test 365_003: Single Interceptor Rule - Compiler Error
//
// Tests that declaring multiple interceptors for the same destination
// causes a compile-time error. Only ONE interceptor per destination allowed.
const std = @import("std");
~import std/interceptors
~event log.write { logline: []const u8 }
~proc log.write|zig {
std.debug.print("{s}\n", .{logline});
}
// First interceptor - OK
~intercept(* -> log.write)
| payload p |> payload { logline: "[A] " ++ p.logline }
// Second interceptor - COMPILE ERROR: duplicate interceptor
~intercept(* -> log.write)
| payload p |> payload { logline: "[B] " ++ p.logline }
~log.write(logline: "Test")
| written _ |> _
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Expected compiler error
error[KORU002]: module not found: '$std/interceptors'
--> tests/regression/300_ADVANCED_FEATURES/365_INTERCEPTORS/365_003_single_interceptor_error/input.kz:7:1
|
7 | ~import "std/interceptors"
| ^
hint: check the import path, koru.json paths, and KORU_STDLIB/KORU_PATH environment variables