Open
Description
The callAsync
macro that was previously shared in the Nim forum works fine with Nim 1.2.x /1.0.x but leads to compile error when used with Nim 1.4.0.
The following gist contains self-contained code illustrating the problem.
The Nim 1.4.0 compiler (and develop
branch) report the following compile error:
$ nim c --threads:on asyncstuff.nim
Hint: used config file '/home/boisvert/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf]
Hint: used config file '/home/boisvert/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf]
.........................................
/home/boisvert/nim/nim14-bug/asyncstuff.nim(33, 46) template/generic instantiation of `async` from here
/home/boisvert/nim/nim14-bug/asyncstuff.nim(34, 28) template/generic instantiation of `await` from here
/home/boisvert/nim/nim14-bug/asyncstuff.nim(17, 13) Error: inconsistent typing for reintroduced symbol 'val`gensym2': previous type was: FlowVar[seq[string]]; new type is: FlowVar[proc (): FlowVar[seq[string]]{.noSideEffect, gcsafe, locks: 0.}]
$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2020-11-15
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 1978b9120250f69df20a5bbb2cb11e73cd3eae5a
active boot switches: -d:release