summary refs log tree commit diff stats
path: root/tests/closure
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-07-22 11:10:44 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-07-22 11:10:52 +0200
commitad608838bf8c6300cb0c62338c4e95c8d2afbeec (patch)
tree17dc5c273b2cf93d2e5778bb3ce62772c4c55eb6 /tests/closure
parent1f13e94dd0bbef5e411eabdce93314f39d1b6394 (diff)
downloadNim-ad608838bf8c6300cb0c62338c4e95c8d2afbeec.tar.gz
closures have an object type field so that we can perform correct deepCopy() for the BoehmGC target
Diffstat (limited to 'tests/closure')
-rw-r--r--tests/closure/tboehmdeepcopy.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/closure/tboehmdeepcopy.nim b/tests/closure/tboehmdeepcopy.nim
new file mode 100644
index 000000000..79ac5797a
--- /dev/null
+++ b/tests/closure/tboehmdeepcopy.nim
@@ -0,0 +1,17 @@
+discard """
+  cmd: "nim c --gc:boehm $options $file"
+  output: '''meep'''
+"""
+
+proc callit(it: proc ()) =
+  it()
+
+proc main =
+  var outer = "meep"
+  proc x =
+    echo outer
+  var y: proc()
+  deepCopy(y, x)
+  callit(y)
+
+main()