summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-02-23 19:47:09 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-02-24 00:32:14 +0100
commit22789a0bfc326ae6a292679b4e9d9eb2a295c26a (patch)
tree1fc7ab515208fb1854384b3312fc9c54d2c5db27 /compiler
parent92c2a51bf763c16579da6b9e2ceaede5552bf5ff (diff)
downloadNim-22789a0bfc326ae6a292679b4e9d9eb2a295c26a.tar.gz
fixes #5419
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semgnrc.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim
index bc80c41ad..9c05ab2f9 100644
--- a/compiler/semgnrc.nim
+++ b/compiler/semgnrc.nim
@@ -174,7 +174,11 @@ proc semGenericStmt(c: PContext, n: PNode,
     # XXX for example: ``result.add`` -- ``add`` needs to be looked up here...
     var dummy: bool
     result = fuzzyLookup(c, n, flags, ctx, dummy)
-  of nkEmpty, nkSym..nkNilLit:
+  of nkSym:
+    let a = n.sym
+    let b = getGenSym(c, a)
+    if b != a: n.sym = b
+  of nkEmpty, succ(nkSym)..nkNilLit:
     # see tests/compile/tgensymgeneric.nim:
     # We need to open the gensym'ed symbol again so that the instantiation
     # creates a fresh copy; but this is wrong the very first reason for gensym