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












                                                     
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)