✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a flow declaring `-> T` whose chain ends on a step producing NOTHING
// is refused, and the refusal is KORU's.
//
// This is the shape the synthesized terminus (210_184) must not paper over.
// `note` returns nothing, so there is no value for `run` to hand back, and the
// old symptom was the host's: "function with non-void return type 'i64'
// implicitly returns", pointing into generated Zig. Reading the last step's
// type is what makes the terminus vanish; reading it is also what makes this
// visible, and both have to come from the same rule or the rule is a guess.
//
// Twin of 210_186 (a chain ending on the wrong type). Same family as 210_181
// and 400_157: a host-language error standing in for a language one.
import std/io
tor seed {} -> i64
proc seed|zig { return 1; }
tor note { subject: i64 }
proc note|zig { _ = subject; }
tor run {} -> i64
run = seed(): a |> note(subject: a)
run(): r |> std/io:print.ln("run = {{ r:d }}")
Actual compiler output
error[KORU094]: 'run' declares `-> i64`, but its chain ends at 'note', which produces no value
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_187_chain_ends_on_step_producing_nothing/input.k:22:0
|
22 | run = seed(): a |> note(subject: a)
| ^
hint: a chain satisfies its flow's `-> i64` when its LAST step returns one. End on a step that produces a i64, or drop the `-> i64` from 'run'.Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
KORU094Flows
subflow ~run click a branch to expand · @labels scroll to their anchor
seed
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_ERROR