✓
Passing This code compiles and runs correctly.
Code
// PIN (2026-07-05, Lars-ruled): a value-event call nested directly as a
// named argument to another call — r1(x: r1(x: 5)) — is ILLEGAL. The
// language idiom is bind-first:
// r1(x: 5): a |> r1(x: a)
// and the corpus is uniformly written that way. Composition lives in the
// flow, where purity, obligations, and lifetimes are checkable — never
// inside expressions.
//
// Guarded by the KORU104 expression-admission wall (flow_checker, Stage A).
// Before the wall, this passed Stage A/B and the emitter pasted the inner
// call's Koru syntax verbatim into emitted Zig (raw Stage-D host error).
// Surfaced by the wordfreq kernel port (koru-benchmarks 19/22).
import std/io
pub event r1 { x: i64 } -> i64
r1 -> @rem(x * 16807, 2147483647)
r1(x: r1(x: 5)): v |> std/io:print.ln("{{ v:d }}")
Frontend must reject with:
CONTAINS error[KORU104
CONTAINS nested call
CONTAINS bindError Verification
Expected Error Pattern
A call nested directly in argument position — r1(x: r1(x: 5)) — is ILLEGAL
(Lars-ruled 2026-07-05). The idiom is bind-first: `r1(x: 5): a |> r1(x: a)`.
Guarded by the KORU104 expression-admission wall (flow_checker, Stage A):
the compiler rejects with "nested call in argument 'x' — calls are not
expressions; use event chaining: bind the result first". This pin holds
that wall up; before it landed, the compiler accepted the shape and leaked
the inner call's Koru syntax verbatim into emitted Zig (raw Stage-D error).Actual Compiler Output
error[KORU104]: nested call in argument 'x' — calls are not expressions; use event chaining: bind the result first
--> tests/regression/320_CONTROL_FLOW/320_127_nested_call_argument/input.k:18:0
|
18 | r1(x: r1(x: 5)): v |> std/io:print.ln("{{ v:d }}")
| ^
hint: rewrite as `event(args): x |> ...` and use `x` hereFlows
flow ~r1 click a branch to expand · @labels scroll to their anchor
r1 (x: r1(x: 5))
Test Configuration
MUST_FAIL