✓
Passing Passing: the compiler rejects this program as expected.
Code
// PIN (2026-07-05): a call inside a PRODUCE (->) expression is ILLEGAL —
// calls are not expressions (see concepts/frag-arguments-are-atoms). The
// idiom is bind-first:
// g(a: 4): x -> 1 + x
//
// Guarded by the KORU104 expression-admission wall (flow_checker, Stage A).
// Bare-return impls parse as `immediate_impl` items with the produce text
// in plain_value — the wall walks those items explicitly. Before the wall:
// `return 1 + g(a: 4);` pasted verbatim into emitted Zig, raw Stage-D error.
import std/io
pub tor g { a: i64 } -> i64
g -> a + 1
pub tor outer {} -> i64
outer -> 1 + g(a: 4)
outer(): v |> std/io:print.ln("{{ v:d }}")
Actual compiler output
error[KORU104]: nested call in a produce (`->`) expression — calls are not expressions; use tor chaining: bind the result first
--> tests/regression/320_CONTROL_FLOW/320_129_call_in_produce_expression/input.k:16:0
|
16 | outer -> 1 + g(a: 4)
| ^
hint: rewrite as `tor(args): x |> ...` and use `x` hereFrontend must reject with:
CONTAINS error[KORU104
CONTAINS nested call
CONTAINS chainFlows
flow ~outer click a branch to expand · @labels scroll to their anchor
outer
Test Configuration
MUST_ERROR