✓
Passing Passing: the compiler rejects this program as expected.
Code
// A `-> { x: T = <expr> }` record return carries defaults inside the type
// text; the emitter splices the record verbatim into the Output struct.
// A call in a return-field default is the same violation the
// expression-admission wall refuses elsewhere — calls are not expressions.
~import std/io
~tor helper {} -> i64
~proc helper|zig { return 42; }
~pub tor poll {} -> { v: i64 = helper(), w: i64 }
~proc poll|zig { return .{ .v = 1, .w = 2 }; }
~poll(): r |> std/io:print.ln("{{ r.v:d }}")
Actual compiler output
error[KORU104]: nested call in a return-field default — calls are not expressions; use tor chaining: bind the result first
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_264_call_in_return_field_default_refused/input.kz:11:0
|
11 | ~pub tor poll {} -> { v: i64 = helper(), w: i64 }
| ^
hint: rewrite as `tor(args): x |> ...` and use `x` hereFrontend must reject with:
CONTAINS error[KORU104]
CONTAINS return-field default
CONTAINS calls are not expressions
ERROR_AT 11Flows
flow ~poll click a branch to expand · @labels scroll to their anchor
poll
Test Configuration
MUST_ERROR