aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/global_then_use.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/global_then_use.zc')
-rw-r--r--tests/errors/global_then_use.zc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/errors/global_then_use.zc b/tests/errors/global_then_use.zc
new file mode 100644
index 0000000..ce01872
--- /dev/null
+++ b/tests/errors/global_then_use.zc
@@ -0,0 +1,6 @@
+namespace;
+include rt;
+
+// expect: x: used after it was given away
+let g;
+fn main() { let x = rt.new(1); g = x; return x[0]; }