✓
Passing This code compiles and runs correctly.
Code
// PINS: a branch that carries a payload must be bound or explicitly discarded.
//
// | result r |> binds the payload to 'r'
// | result _ |> explicitly discards it
// | result |> names the branch and drops the payload on the floor
//
// The third form is the one refused, and the refusal must name the branch.
//
// Two branches, not one: a lone payload-carrying branch is refused at the
// DECLARATION by PARSE003 ("declare the single output as a bare return
// instead"), which masks this case entirely at one branch.
const std = @import("std");
~import std/io
~tor compute { x: i32 }
| result i32
| skipped
~compute => result x * 2
~compute(x: 42)
| result |> std/io:print.ln("done")
| skipped |> _
Flows
flow ~compute click a branch to expand · @labels scroll to their anchor
compute (x: 42)
Test Configuration
Expected Error:
branch 'result' has payload but no binding