✓
Passing This code compiles and runs correctly.
Code
// Destructured fields are bindings: each named field must be USED or be
// spelled `_` — KORU100 per field, the same linear discipline as any
// binding. `age` is named but never read.
~import std/io
~pub event fetch {}
| found { name: []const u8, age: i64 }
~proc fetch|zig { return .{ .found = .{ .name = "lars", .age = 44 } }; }
~fetch()
| found { name, age } |> std/io:print.ln("only {{ name:s }}")
Must contain:
unused binding 'age'Error Verification
Actual Compiler Output
error[KORU100]: unused binding 'age'
--> flow_check:13:0
❌ Compiler coordination error: Flow validation failed
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_019_reject_destructure_unused_field/backend.zig:94:13: 0x104e8a1b7 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_019_reject_destructure_unused_field/backend.zig:190:28: 0x104e8aea3 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^Test Configuration
MUST_FAIL