010 no function calls in payload

○ Planned This feature is planned but not yet implemented.

DESIGN: Interceptor feature not yet implemented. Should produce compile error for function calls in payload constructors.

Code

// Test 365_010: No Function Calls in Payload Constructors
//
// NEGATIVE TEST: Function calls are NOT allowed in branch/payload constructors.
// This ensures purity tracking is possible - all side effects must be explicit
// event calls, not hidden function invocations.
//
// The correct way to use impure operations is via event chains:
//   | payload p |> get_time()
//       | timestamp ts |> payload { logline: p.logline, ts: ts }

const std = @import("std");
~import "$std/interceptors"

~event log.write { logline: []const u8 }

~proc log.write {
    std.debug.print("{s}\n", .{logline});
}

// INVALID: Function call timestamp() inside payload constructor
// This should be a compile error!
~intercept(* -> log.write)
| payload p |> payload { logline: p.logline ++ timestamp() }

~log.write(logline: "Test")
| written _ |> _
input.kz

Expected

error[KORU002]: module not found: '$std/interceptors'
  --> tests/regression/300_ADVANCED_FEATURES/365_INTERCEPTORS/365_010_no_function_calls_in_payload/input.kz:12:1
    |
 12 | ~import "$std/interceptors"
    | ^
  hint: check the import path, koru.json paths, and KORU_STDLIB/KORU_PATH environment variables

Test Configuration

Expected Behavior:

FRONTEND_COMPILE_ERROR