✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: ImmediateImpl.location names the `name ->` head line. A refusal
// that reads it raw — here KORU021, a bare return cannot construct a
// branch of a tor that declares them — lands its caret on the author's
// impl line.
import std/io
tor f { a: i64 }
| done { x: i64, y: i64 }
| fail
f -> a
f(a: 1)
| done d |> std/io:print.ln("{{ d.x:d }} {{ d.y:d }}")
| fail |> std/io:print.ln("f")
Actual compiler output
error[KORU021]: tor 'f' declares branches, so its implementation constructs one — a bare return (`->`) produces no branch tag
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_261_bare_return_impl_caret_on_head/input.k:11:0
|
11 | f -> a
| ^
hint: implement it with the branch constructor instead: `~f => <branch> <value>`, naming one of: done, failFrontend must reject with:
CONTAINS error[KORU021]
CONTAINS bare return
ERROR_AT 11Flows
flow ~f click a branch to expand · @labels scroll to their anchor
f (a: 1)
Test Configuration
MUST_ERROR