fix #12094 Use of _ (as var placeholder) inside a template causes XDeclaredButNotUsed
This commit is contained in:
parent
8ed2431db0
commit
4728c52c78
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue