summary refs log tree commit diff stats
path: root/compiler/sem.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-12-09 12:58:33 +0100
committerGitHub <noreply@github.com>2018-12-09 12:58:33 +0100
commitc16963083d828b7920c221a5031b509c9824db4a (patch)
tree96bb340f7bad42f8289604c5cd2c7066d0a41e9d /compiler/sem.nim
parent8035f408f1323ba81c8db794ad58687bace78afa (diff)
parente8747059710370819800bdc0742fa86761c6737b (diff)
downloadNim-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.nim11
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