From 78bf3e039d77e3eb0d5e394273adb69b2b70a76d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 17 Mar 2025 02:12:02 +0200 Subject: detect leaks --- examples/err.fwd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/err.fwd (limited to 'examples/err.fwd') diff --git a/examples/err.fwd b/examples/err.fwd new file mode 100644 index 0000000..f2833e2 --- /dev/null +++ b/examples/err.fwd @@ -0,0 +1,17 @@ +do_something((auto, auto) ok); + +/* consume can fail */ +consume(auto a); + +main() +{ + do_something() => auto a, auto b; + consume(a); + /* try commenting out error handler or consume(b); */ + !> e { + consume(b); + error "a failed" + } + + consume(b); +} -- cgit v1.2.3