✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test 020_032: An event with a declared output, INVOKED in the flow, but with
// NO implementation anywhere (no proc, no bare-return impl, no subflow) must be
// a COMPILE ERROR — never a silent zero-default stub.
//
// Today the emitter's !found_impl path (visitor_emitter.zig) synthesizes
// `return .{ .<first-terminal> = 0 }` and the program prints a confident wrong
// answer. That silent fallback is how five AoC honest-red days printed zeros
// instead of failing. The stub is legitimate ONLY where the handler is provably
// never called (template procs, effect-only events, auto-proc passthrough) —
// an invoked event with no implementation is a hole in the program and must
// fail loudly at the koru level.
//
// Grounded on 020_021_event_arrow_return with the `double -> a * 2`
// implementation line deleted.
import std/io
pub tor double { a: i32 } -> i32
double(a: 21): d |> std/io:print.ln("{{ d:d }}")
Actual compiler output
error[KORU047]: event 'input:double' is invoked but has no implementation — without one the compiler would silently stub it to return zero-defaults. Implement it with a proc (`~proc double|zig { ... }`), a bare-return impl (`~double -> <value>`), a branch constructor (`~double => <branch> <value>`), or a subflow (`~double = <flow>`)
--> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_032_reject_unimplemented_event_invocation/input.k:19:0
❌ Compiler coordination error: Validation failed (see errors above)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime:
Program must error when executed.
Error output must contain
no implementationFlows
flow ~double click a branch to expand · @labels scroll to their anchor
double (a: 21)
Test Configuration
MUST_ERROR