aboutsummaryrefslogtreecommitdiff
path: root/tests/hold/reject/closure.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hold/reject/closure.zc')
-rw-r--r--tests/hold/reject/closure.zc5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/hold/reject/closure.zc b/tests/hold/reject/closure.zc
new file mode 100644
index 0000000..5c082d2
--- /dev/null
+++ b/tests/hold/reject/closure.zc
@@ -0,0 +1,5 @@
+// error: c: is shared; a closure can't use it
+namespace;
+include rt;
+hold { shared let c; fn a() { let f = fn() { return c; }; return f(); } }
+fn main() { return a(); }