✓
Passing Passing: the compiler rejects this program as expected.
Code
// The panic variant of the `-> T` + `| branch` collision: `| ?!badjob` is
// an armable union member, and the bare return's share of that union emits
// an invalid empty tag — raw-Zig death, not just unreachable vocabulary.
// The wall covers panic arms too (210_309 pins the named-branch mix).
import std/io
tor probe { n: u32 } -> u32
| ?!badjob i64
proc probe|zig {
return n;
}
probe(n: 3): r |> std/io:print.ln("got {{ r:d }}")
Actual compiler output
error[PARSE003]: tor 'probe' declares a bare return `-> u32` AND named `| badjob` outcomes — a bare return has no tags, so every declared branch is unreachable at the call site. Pick one contract: `-> T` alone, or named `| branch` outcomes with no `->`
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_310_bare_return_panic_branch_refused/input.k:7:1
|
7 | tor probe { n: u32 } -> u32
| ^Frontend must reject with:
CONTAINS error[PARSE003]
CONTAINS a bare return has no tags
NOT_CONTAINS output_emitted.zigTest Configuration
MUST_ERROR