mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
18 lines
329 B
Nim
18 lines
329 B
Nim
discard """
|
|
line: 17
|
|
errormsg: "'mainUnsafe' is not GC-safe"
|
|
cmd: "nim $target --hints:on --threads:on $options $file"
|
|
"""
|
|
|
|
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)
|