✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the bind-position twin of 210_271 — an annotation on a head
// return destructure (`~f(): { [row]h }`) has no consumer either and
// refuses KORU175 on the call line rather than being dropped by the
// emitted per-field consts.
~import std/io
~tor make2 { id: i64 } -> { h: i64, g: i64 }
~proc make2|zig {
return .{ .h = 1, .g = 2 };
}
~make2(id: 1): { [row]h } |> std/io:print.ln("h = {{ h:d }}")
Actual compiler output
error[KORU175]: destructure annotation '[row]' on 'h' has no consumer here — annotations are requests a transform implements; nothing on this path reads them
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_272_return_destructure_annotation_refused/input.kz:12:0
|
12 | ~make2(id: 1): { [row]h } |> std/io:print.ln("h = {{ h:d }}")
| ^
hint: drop the annotation, or put the destructure on a consumer that implements it (std/store's query arm owns [row]/[ordinal]/[id])Frontend must reject with:
CONTAINS error[KORU175]
CONTAINS '[row]'
CONTAINS 'h'
ERROR_AT 12
NOT_CONTAINS output_emitted.zigFlows
flow ~make2 click a branch to expand · @labels scroll to their anchor
make2 (id: 1)
Test Configuration
MUST_ERROR