summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBigEpsilon <BigEpsilon@users.noreply.github.com>2017-08-30 14:44:11 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-08-30 14:44:11 +0200
commit6f6e6fe4eb812e78e087919b69c6b1d023c8536f (patch)
tree9d78be12ee644a51fc5335b01431e3d916918a77
parent28da04c1f7336a4eecc22e3eaa85cb9fe1b30e77 (diff)
downloadNim-6f6e6fe4eb812e78e087919b69c6b1d023c8536f.tar.gz
Fix #6295 (#6296)
-rw-r--r--compiler/renderer.nim2
-rw-r--r--tests/macros/tgenericparams.nim13
2 files changed, 14 insertions, 1 deletions
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()