aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/6-ownership/outer_owner_in_inner_container.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 17:50:10 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 17:50:10 +0330
commit251b0212f626d0f92eda51906d353712ef4a63b8 (patch)
tree4f0e0b0ee6b0f6d0671261a46bb2bcd15ef0f59c /tests/conformance/6-ownership/outer_owner_in_inner_container.zc
parentmerge work/actors: wasm seed bootstrap (seed/MANIFEST), shared copy-on-write ... (diff)
parentprescan: guess an owned return only from a local declared from new/heap, not ... (diff)
merge work/demo-fixes: analyzer ownership fixes (back links, loop-built lists, .u inference), Io.print any args, block-end borrow messages
Diffstat (limited to 'tests/conformance/6-ownership/outer_owner_in_inner_container.zc')
-rw-r--r--tests/conformance/6-ownership/outer_owner_in_inner_container.zc13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/conformance/6-ownership/outer_owner_in_inner_container.zc b/tests/conformance/6-ownership/outer_owner_in_inner_container.zc
new file mode 100644
index 0000000..d9043c0
--- /dev/null
+++ b/tests/conformance/6-ownership/outer_owner_in_inner_container.zc
@@ -0,0 +1,13 @@
+// expect error: head: belongs to item, which was freed at the end of its block (line 10)
+// spec 6.8.5
+include rt;
+struct node { int value; node* next; };
+fn main() {
+ node* head = rt.new(node);
+ {
+ node* item = rt.new(node);
+ item.next = head;
+ }
+ rt.put_n(head.value);
+}
+// zc0: skip