✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// Test 210_096: MUST_FAIL — a BARE path argument whose last segment puns to a
// name that is NOT a parameter must be REJECTED at the koru frontend.
// Bare-side twin of 210_091's legal `echo(v: box.other)`.
//
// `echo(box.other)` puns to 'other' (last segment), but the only parameter
// is 'v'. The legal spelling is `echo(v: box.other)`.
//
// CURRENT BEHAVIOR (the bug this pins, worse than 210_094/095): the koru
// frontend ACCEPTS it and codegen emits MALFORMED Zig referencing an
// undeclared `v`. The frontend never complains — the harness even reports
// "compilation SUCCEEDED" — and the only thing that catches it is the Zig
// compiler at the final executable build:
// output_emitted.zig: error: use of undeclared identifier 'v'
// That raw host-level leak is itself a defect (the koru-level wall isn't
// built here). This test pins BOTH: the missing rejection AND that it must
// surface as a clean FRONTEND koru error, never as broken emitted Zig.
// Diagnostic wording is a design call (TBD with the fix).
// ============================================================================
~import std/io
~event echo { v: i32 }
| out i32
~echo => out v
~event get-box {}
| got { v: i32, other: i32 }
~proc get-box|zig { return .{ .got = .{ .v = 7, .other = 11 } }; }
~get-box()
| got box |> echo(box.other)
| out r |> std/io:print.ln("{{ r:d }}")
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error Verification
Actual Compiler Output
error[PARSE006]: bare argument 'box.other' does not name a parameter of 'echo' — an explicit label is required
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_096_reject_bare_path_name_mismatch/input.kz:34:0
|
34 | | got box |> echo(box.other)
| ^
hint: write it with an explicit label: 'v: box.other'Flows
flow ~get-box click a branch to expand · @labels scroll to their anchor
get-box
Test Configuration
MUST_FAIL