fixes 'gcsafe'

This commit is contained in:
Araq 2014-08-12 08:47:31 +02:00
commit b8ce3a4175
8 changed files with 56 additions and 22 deletions

16
tests/effects/tgcsafe.nim Normal file
View file

@ -0,0 +1,16 @@
discard """
line: 15
errormsg: "'mainUnsafe' is not GC-safe"
"""
proc mymap(x: proc ()) =
x()
var
myglob: string
proc mainSafe() {.gcsafe.} =
mymap(proc () = echo "foo")
proc mainUnsafe() {.gcsafe.} =
mymap(proc () = myglob = "bar"; echo "foo", myglob)