aboutsummaryrefslogtreecommitdiff
path: root/tests/actor/reject/drop_message.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/actor/reject/drop_message.zc')
-rw-r--r--tests/actor/reject/drop_message.zc13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/actor/reject/drop_message.zc b/tests/actor/reject/drop_message.zc
new file mode 100644
index 0000000..fb37d5f
--- /dev/null
+++ b/tests/actor/reject/drop_message.zc
@@ -0,0 +1,13 @@
+// destructors 7: copying a value with a drop into an actor message is an error; two processes would drop it twice
+namespace;
+include rt, actor;
+struct res { int fd; void drop() { rt.put_s("closed"); } }
+actor Keeper { int total; int handle(res* r) { return r.fd; } }
+fn main() {
+ Keeper* k = rt.new(Keeper);
+ res* r = rt.new(res); r.fd = 3;
+ k.spawn();
+ k.send(r);
+ k.close();
+ return 0;
+}