aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/global_child.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/global_child.zc')
-rw-r--r--tests/errors/global_child.zc7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/errors/global_child.zc b/tests/errors/global_child.zc
new file mode 100644
index 0000000..9b51da9
--- /dev/null
+++ b/tests/errors/global_child.zc
@@ -0,0 +1,7 @@
+namespace;
+include rt;
+
+// expect: x: is not an owner, so it can't be stored in a global
+struct box { int* v; };
+let g;
+fn main() { box* b = rt.new(box); int* x = rt.new(int); b.v = x; g = x; return 0; }