diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-02-17 10:48:01 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-02-17 10:48:01 +0100 |
commit | ba29ca0c63e50a06baf5935235b85e4ddc28fc96 (patch) | |
tree | abfeee6348d6419ba37fd4b938b5916dea66c6e9 /compiler/seminst.nim | |
parent | 1189ae9b99eff08dc34f2d5338c65ca2096ca297 (diff) | |
parent | e9767d8809a0ff4df83ffff1836937db3c2885bf (diff) | |
download | Nim-ba29ca0c63e50a06baf5935235b85e4ddc28fc96.tar.gz |
Merge branch 'devel' into faster-nimsuggest
Diffstat (limited to 'compiler/seminst.nim')
-rw-r--r-- | compiler/seminst.nim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 9c57be023..acaade494 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -106,15 +106,18 @@ 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 + elif s.owner.kind == skPackage: + #echo "copied this ", s.name.s x = copySym(s, false) x.owner = owner idTablePut(symMap, s, x) - n.sym = x + n.sym = x else: for i in 0 .. <safeLen(n): freshGenSyms(n.sons[i], owner, orig, symMap) |