closures have an object type field so that we can perform correct deepCopy() for the BoehmGC target

This commit is contained in:
Andreas Rumpf
2017-07-22 11:10:44 +02:00
parent 1f13e94dd0
commit ad608838bf
7 changed files with 40 additions and 19 deletions

View File

@@ -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()