summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/semstmts.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 596995adb..81be67725 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -370,7 +370,8 @@ proc addToVarSection(c: PContext; result: var PNode; orig, identDefs: PNode) =
     result.add identDefs
 
 proc isDiscardUnderscore(v: PSym): bool =
-  if v.name.s == "_":
+  # template generated underscore symbol name starts with _`gensym
+  if v.name.s == "_" or v.name.s.startsWith("_`"):
     v.flags.incl(sfGenSym)
     result = true