✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a tor line inside a `captured { }` field body is REFUSED — the
// field-value scanner may not swallow a following `!` / `|>` line as
// expression continuation. Sibling of 100_083 (unclosed paren in a
// capture value): same silent-absorption failure mode, different door —
// this one is a tor line, not a stray bracket.
//
// Found by the composition GP fuzzer: a spliced `! row` subtree inside
// `captured {}` compiled green under --deep-check while the emitted Zig
// carried the Koru line verbatim — `acc.n = acc.n + 1\n! bogus e |> ...` —
// which is not parseable Zig. `zig ast-check` fails on the emission; the
// "pass" was a frontend that accepted what it never checked.
//
// Pinned KORU164 at write time; the wall that fires is KORU104 — the
// expression-admission scan strengthened (parseAll catches namespaced
// callees, f2fa2e83) and now names the fused call inside field 'n' before
// the capture transform's own refusal can run.
import std/io
import std/fs
capture { n: 0[i64] }
! as acc |> std/fs:read-lines(path: "nonexistent.txt")
! line _ |> captured {
n: acc.n + 1
! bogus e |> std/io:print.ln("x")
}
| captured total |> std/io:print.ln("{{ total.n:d }}")
Actual compiler output
error[KORU104]: nested call in captured field 'n' — calls are not expressions; use tor chaining: bind the result first
--> tests/regression/100_PARSER/100_089_captured_field_swallows_tor_line/input.k:22:5
|
22 | ! line _ |> captured {
| ^
hint: rewrite as `tor(args): x |> ...` and use `x` hereFrontend must reject with:
CONTAINS error[KORU104]
CONTAINS nested call in captured field 'n'Flows
flow ~capture click a branch to expand · @labels scroll to their anchor
capture (source: n: 0[i64])
Test Configuration
MUST_ERROR