summary refs log tree commit diff stats
path: root/compiler/seminst.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-02-16 00:43:14 +0100
committerAraq <rumpf_a@web.de>2017-02-16 00:43:14 +0100
commit97e26967f1f37a33edf6877cedfc9854fabab5eb (patch)
tree083851e15d15f26118b23b0db1330b8f5ccb6fcf /compiler/seminst.nim
parent95abf30fae3d1d91e1980fa9a5a46e7319201cd8 (diff)
downloadNim-97e26967f1f37a33edf6877cedfc9854fabab5eb.tar.gz
fixes #5383
Diffstat (limited to 'compiler/seminst.nim')
-rw-r--r--compiler/seminst.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim
index 9c57be023..1a96b4bc6 100644
--- a/compiler/seminst.nim
+++ b/compiler/seminst.nim
@@ -106,15 +106,16 @@ proc freshGenSyms(n: PNode, owner, orig: PSym, symMap: var TIdTable) =
   #if n.kind == nkSym and sfGenSym in n.sym.flags:
   #  if n.sym.owner != orig:
   #    echo "symbol ", n.sym.name.s, " orig ", orig, " owner ", n.sym.owner
-  if n.kind == nkSym and {sfGenSym, sfFromGeneric} * n.sym.flags == {sfGenSym}: # and
+  if n.kind == nkSym and sfGenSym in n.sym.flags: # and
     #  (n.sym.owner == orig or n.sym.owner.kind in {skPackage}):
     let s = n.sym
     var x = PSym(idTableGet(symMap, s))
-    if x == nil:
+    if x != nil:
+      n.sym = x
+    when false:
       x = copySym(s, false)
       x.owner = owner
       idTablePut(symMap, s, x)
-    n.sym = x
   else:
     for i in 0 .. <safeLen(n): freshGenSyms(n.sons[i], owner, orig, symMap)