-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
When using a (proc) parameter in the return type inside a template, it is not gensym'd.
Example
from std/macros import expandMacros
expandMacros:
template test() =
proc foo(a: typedesc): a =
default(a)Current Output
template main() =
proc foo(a_385876008: typedesc): a =
default(a_385876008)
Expected Output
template main() =
proc foo(a_385876008: typedesc): a_385876008 =
default(a_385876008)
Possible Solution
This can probably fixed in a similar fashion to #16874.
Additional Information
This also happens when the parameter is used in a nested construct, like a function call.
I found this in #17432.
$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-03-21
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: b70e33f5bbb7b9c146c97d39aabae57504f4ee75
active boot switches: -d:release
EDIT: Use typedesc.
Metadata
Metadata
Assignees
Labels
No labels