fixes 'gcsafe'
This commit is contained in:
parent
05dbba0e38
commit
b8ce3a4175
8 changed files with 56 additions and 22 deletions
|
|
@ -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
16
tests/effects/tgcsafe.nim
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue