✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 681_001_catch_answers_unhandled: `std/panic:catch` relocated
// into an imported module.
//
// catch is the one non-keyword transform in this batch — a site-pattern
// graft over an expression. Mirroring it checks the graft resolves a flow
// declared in the same module, not just the entry file.
import app/lib
app/lib:run()
Supporting Files
import std/io
import std/panic
pub tor risky { code: i64 }
| ok i64
| ?!bad i64
risky = if(code < 0)
| then => bad code
| else => ok code
pub tor run {}
run = std/panic:catch(risky)
! bad v |> std/io:print.ln("caught {{ v:d }}")
risky(code: -1)
| ok v |> std/io:print.ln("ok {{ v:d }}")
Actual
caught -1
Expected output
caught -1
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN