summary refs log blame commit diff stats
path: root/tests/effects/tgcsafe.nim
blob: ff207df59e0e80c59ee94368c3ba2099a8c50fdb (plain) (tree)
1
2
3
4
           
                                         
          
                                                           












                                                     
discard """
  errormsg: "'mainUnsafe' is not GC-safe"
  line: 17
  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)