todo proc type should indicate gcsafe

when compiling with `--threads:on` if `{.gcsafe.}` is not indicated for
`todo: proc(c: Client): Future[void]` then compilation will fail with
"Error: 'runner' is not GC-safe as it performs an indirect call via 'todo'"

see the logic in `proc trackProc` of `compiler/sempass2.nim`:
https://github.com/nim-lang/Nim/blob/v1.6.6/compiler/sempass2.nim#L1394
This commit is contained in:
Michael Bradley, Jr 2022-08-17 16:50:48 -05:00 committed by Michael Bradley
parent a11ced18ff
commit 3574ef490d
1 changed files with 1 additions and 1 deletions

View File

@ -220,7 +220,7 @@ proc param*[T](c: Client, _: type[T], name: string): T =
else:
{.error: "Unsupported type for param".}
proc runner(todo: proc(c: Client): Future[void]) {.async.} =
proc runner(todo: proc(c: Client): Future[void] {.gcsafe.}) {.async.} =
let
c = Client(
testRun: getEnv("TEST_RUN"),