Implements #2154.
When unpacking tuples in var/let declarations a part of the tuple can now be discarded using a single underscore.
This commit is contained in:
parent
3751019823
commit
b38eb2e2a8
8 changed files with 39 additions and 6 deletions
|
|
@ -403,7 +403,8 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
|
|||
|
||||
for j in countup(0, length-3):
|
||||
var v = semIdentDef(c, a.sons[j], symkind)
|
||||
if sfGenSym notin v.flags: addInterfaceDecl(c, v)
|
||||
if sfGenSym notin v.flags and
|
||||
a.sons[j].kind != nkUnderscore: addInterfaceDecl(c, v)
|
||||
when oKeepVariableNames:
|
||||
if c.inUnrolledContext > 0: v.flags.incl(sfShadowed)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue