fixes 'gcsafe'

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

View File

@@ -1,5 +1,5 @@
discard """
line: 1913
line: 2136
file: "system.nim"
errormsg: "can raise an unlisted exception: ref EIO"
"""

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)