diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 7d9536625..220693f68 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -1327,7 +1327,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = if n.hasExplicitParams: put(g, tkBracketLe, "[") - gcomma(g, n) + gsemicolon(g, n) put(g, tkBracketRi, "]") of nkFormalParams: put(g, tkParLe, "(") diff --git a/tests/macros/tgenericparams.nim b/tests/macros/tgenericparams.nim new file mode 100644 index 000000000..d656f045a --- /dev/null +++ b/tests/macros/tgenericparams.nim @@ -0,0 +1,13 @@ +discard """ +output: '''proc foo[T, N: static[int]]() +proc foo[T; N: static[int]]()''' +""" +import macros + +macro test():string = + let expr0 = "proc foo[T, N: static[int]]()" + let expr1 = "proc foo[T; N: static[int]]()" + + $toStrLit(parseExpr(expr0)) & "\n" & $toStrLit(parseExpr(expr1)) + +echo test()