✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: KORU108 — an arm binding referenced at the join after the arms is
// refused by the core flow checker. `t` is bound by `| img t`; the join
// (400_210) runs after whichever arm fired, so `t` is not on its path.
import std/io
pub tor load { n: i64 }
| img i64
| err i64
load = if(n < 0)
| then => err n
| else => img n
pub tor show { v: i64 }
show = std/io:print.ln("v {{ v:d }}")
std/io:print.ln("start")
|> load(n: 3)
| img t |> show(v: t)
| err e |> show(v: e)
|> show(v: t)
Actual compiler output
error[KORU108]: 't' is not in scope here — it is bound by '| img t', and an arm's bindings end with that arm
--> tests/regression/400_RUNTIME_FEATURES/400_213_join_reference_to_arm_binding_refused/input.k:22:5
|
22 | |> show(v: t)
| ^
hint: move this step into the arm bodyMust fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
error[KORU108]: 't' is not in scope hereFlows
subflow ~load click a branch to expand · @labels scroll to their anchor
if (n < 0)
subflow ~show click a branch to expand · @labels scroll to their anchor
print.ln (expr: "v {{ v:d }}")
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "start")
Test Configuration
MUST_ERROR