✓
Passing Passing: the compiler rejects this program as expected.
Code
// TEST: unspaced `-` between bound names inside an invocation argument
//
// Same ruling as 220_052, one carrier over: `v: q-b` is an argument value,
// and the checker scans argument text. `q-b` reads as one kebab identifier —
// unbound — while `q` and `b` both resolve, so the checker teaches the
// spaced spelling rather than passing `q-b` through to Zig, which would
// read subtraction and produce the right answer for the wrong reason.
import std/io
tor sink { v: i64 } -> i64
sink -> v
tor diff { q: i64, b: i64 } -> i64
diff = sink(v: q-b): r
|> produce(r)
diff(q: 10, b: 3): r |> std/io:print.ln("{{ r:d }}")
Actual compiler output
error[KORU181]: 'q-b' reads as one name, not subtraction — `-` joins identifiers (kebab), and no 'q-b' is declared
--> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_053_unspaced_minus_in_invocation_arg/input.k:15:1
|
15 | diff = sink(v: q-b): r
| ^
hint: write 'q - b' for subtractionFrontend must reject with:
CONTAINS error[KORU181
CONTAINS reads as one name, not subtraction
CONTAINS write 'q - b' for subtractionFlows
subflow ~diff click a branch to expand · @labels scroll to their anchor
sink (v: q-b)
flow ~diff click a branch to expand · @labels scroll to their anchor
diff (q: 10, b: 3)
Test Configuration
MUST_ERROR