diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-12-09 12:58:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-09 12:58:33 +0100 |
commit | c16963083d828b7920c221a5031b509c9824db4a (patch) | |
tree | 96bb340f7bad42f8289604c5cd2c7066d0a41e9d /compiler/sem.nim | |
parent | 8035f408f1323ba81c8db794ad58687bace78afa (diff) | |
parent | e8747059710370819800bdc0742fa86761c6737b (diff) | |
download | Nim-c16963083d828b7920c221a5031b509c9824db4a.tar.gz |
Merge pull request #9912 from nim-lang/araq-fixes-nested-gensym
fixes nested gensym'ed parameters; fixes #9476
Diffstat (limited to 'compiler/sem.nim')
-rw-r--r-- | compiler/sem.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim index 924e53b66..8332af346 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -207,11 +207,12 @@ proc newSymG*(kind: TSymKind, n: PNode, c: PContext): PSym = if result.kind notin {kind, skTemp}: localError(c.config, n.info, "cannot use symbol of kind '" & $result.kind & "' as a '" & $kind & "'") - if sfGenSym in result.flags and result.kind notin {skTemplate, skMacro, skParam}: - # declarative context, so produce a fresh gensym: - result = copySym(result) - result.ast = n.sym.ast - put(c.p, n.sym, result) + when false: + if sfGenSym in result.flags and result.kind notin {skTemplate, skMacro, skParam}: + # declarative context, so produce a fresh gensym: + result = copySym(result) + result.ast = n.sym.ast + put(c.p, n.sym, result) # when there is a nested proc inside a template, semtmpl # will assign a wrong owner during the first pass over the # template; we must fix it here: see #909 |