aboutsummaryrefslogtreecommitdiff
path: root/tests/hold/reject/actor_handler.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 17:03:03 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 17:03:03 +0330
commit7cb983bbea98d2038b2a8015a6d1f1afd40991c9 (patch)
treeec3d88a15801207fc6d8d3c6d142617ffec85460 /tests/hold/reject/actor_handler.zc
parentmerge work/borrow: borrow returns before definition, borrows clause, borrow m... (diff)
parentbench: rss probe path fix (diff)
merge work/actors: wasm seed bootstrap (seed/MANIFEST), shared copy-on-write actor memory, top-level hold blocks on all backends and lsp
Diffstat (limited to 'tests/hold/reject/actor_handler.zc')
-rw-r--r--tests/hold/reject/actor_handler.zc8
1 files changed, 8 insertions, 0 deletions
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<int,int>* a = rt.new(actor.Actor<int,int>); a.spawn(work); a.send(1); a.close(); return 0; }