mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 06:45:27 +00:00
closures have an object type field so that we can perform correct deepCopy() for the BoehmGC target
This commit is contained in:
17
tests/closure/tboehmdeepcopy.nim
Normal file
17
tests/closure/tboehmdeepcopy.nim
Normal 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()
|
||||
Reference in New Issue
Block a user