✓
Passing Passing: the compiler rejects this program as expected.
Code
// TEST: unspaced `-` between bound names reads as one kebab identifier
//
// `-` is a name glyph in Koru, so `q-b` in expression position is ONE
// identifier, not subtraction. When no `q-b` is declared but both `q` and
// `b` resolve, the author almost surely wrote subtraction and the checker
// teaches the spaced spelling instead of letting the token reach Zig.
import std/io
tor pick { } | done i64 | miss
pick => done 1
tor diff { q: i64, b: i64 } -> i64
diff = pick
| done _ -> q-b
| miss -> 0
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_052_unspaced_minus_joins_bound_names/input.k:15:5
|
15 | | done _ -> q-b
| ^
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
pick
flow ~diff click a branch to expand · @labels scroll to their anchor
diff (q: 10, b: 3)
Test Configuration
MUST_ERROR