✓
Passing Passing: the compiler rejects this program as expected.
Code
// `{ policy: missing }` refuses at compile time — the policy must be a
// named tor in this module, consuming `{ f: <payload>, t: i64 }` and
// producing `| retry | exhausted`.
import std/supervisor
pub tor dial { port: i64 }
| ok i64
| refused i64
proc dial|zig {
return .{ .refused = port };
}
pub tor connect { port: i64 }
| ok i64
| refused i64
connect = dial(port)
| ok p => ok p
| refused f |> std/supervisor:supervised { policy: missing }
connect(port: 8080)
Actual compiler output
error[KORU161]: std/supervisor:supervised: no event 'missing' in this module — 'policy:' names a tor consuming '{ f: <failure payload>, t: i64 }' and producing `| retry {<child args>} | exhausted`
--> tests/regression/320_CONTROL_FLOW/320_163_supervised_policy_missing_refuses/input.k:20:0Compiler must reject:
Compilation must fail with a diagnostic.
Flows
subflow ~connect click a branch to expand · @labels scroll to their anchor
dial (port)
flow ~connect click a branch to expand · @labels scroll to their anchor
connect (port: 8080)
Test Configuration
MUST_ERROR