mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
fixes 'gcsafe'
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user