summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-08-03 23:35:59 -0700
committerOri Bernstein <ori@eigenstate.org>2018-08-03 23:36:54 -0700
commit80ad746d8032274e2e6b40d3e4d801aa2085082d (patch)
tree198beefbb3e252d4fabc4cd66f7b5623897111d9 /test
parent17b5405f1035985d60539f7d777b77cf56e7231a (diff)
downloadmc-80ad746d8032274e2e6b40d3e4d801aa2085082d.tar.gz
Record the closure into all nested funcs.
Funcs can go inside funcs.
Diffstat (limited to 'test')
-rw-r--r--test/nestclosure.myr11
-rw-r--r--test/tests1
2 files changed, 12 insertions, 0 deletions
diff --git a/test/nestclosure.myr b/test/nestclosure.myr
new file mode 100644
index 0000000..05a55a7
--- /dev/null
+++ b/test/nestclosure.myr
@@ -0,0 +1,11 @@
+use std
+
+const main = {
+ var a = 1
+ var f = std.fndup({
+ {
+ std.put("{}\n", a)
+ }()
+ })
+ f()
+}
diff --git a/test/tests b/test/tests
index 2291b7e..4ac4fb0 100644
--- a/test/tests
+++ b/test/tests
@@ -64,6 +64,7 @@ B callbig E 42
B nestfn E 42
B foldidx P 123,456
B closure P 111555333666
+B nestclosure P 1
B closurerec E 21
B fncast P ok
B loop P 0123401236789