mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
fix #12094 Use of _ (as var placeholder) inside a template causes XDeclaredButNotUsed
(cherry picked from commit 4728c52c78)
This commit is contained in:
@@ -360,7 +360,8 @@ proc addToVarSection(c: PContext; result: 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user