From 25aa655e5b9464e291d542081ed1cf0f8fd666af Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 14:33:28 +0330 Subject: hold: fixtures (accept, reject, race, rank order) and tests/drivers/hold_test.py --- tests/hold/reject/actor_handler.zc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/hold/reject/actor_handler.zc (limited to 'tests/hold/reject/actor_handler.zc') diff --git a/tests/hold/reject/actor_handler.zc b/tests/hold/reject/actor_handler.zc new file mode 100644 index 0000000..5548cad --- /dev/null +++ b/tests/hold/reject/actor_handler.zc @@ -0,0 +1,8 @@ +// error: total: is shared in a hold block; only the functions written inside that block can use it +// shared state reached from an actor's handler without going through its hold block +namespace; +include rt, actor; +typecheck on; +hold { shared let total; fn add(int n) { total = total + n; return total; } } +int work(int n) { total = total + n; return n; } +fn main() { actor.Actor* a = rt.new(actor.Actor); a.spawn(work); a.send(1); a.close(); return 0; } -- cgit v1.2.3