✓
Passing This code compiles and runs correctly.
Code
// TEST: std/panic — a catch decl that answers nothing is a refusal, not a
// no-op. The same discipline as testing's unused-mock error: a pillow that
// grafted zero arms is either a stale pattern or a solved problem, and both
// deserve a loud compile, not a silent pass.
import std/io
import std/panic
pub tor safe { n: i64 } -> i64
safe = n * 2
std/panic:catch(safe)
! bad v |> std/io:print.ln("caught {{ v:d }}")
safe(n: 2): v |> std/io:print.ln("{{ v:d }}")
Error output must contain
error[KORU179]: std/panic:catch(safe) answered nothing - no unhandled ?! site matched; the pattern is stale or the problem is already solvedFlows
subflow ~safe click a branch to expand · @labels scroll to their anchor
n * 2
flow ~catch click a branch to expand · @labels scroll to their anchor
catch (expr: safe)
flow ~safe click a branch to expand · @labels scroll to their anchor
safe (n: 2)