Fix const tuple unpacking not working for variables > 2 (#10099)
This commit is contained in:
parent
58d293d6a9
commit
65a52ecebb
1 changed files with 1 additions and 1 deletions
|
|
@ -580,7 +580,7 @@ proc semConst(c: PContext, n: PNode): PNode =
|
||||||
if a.kind == nkVarTuple:
|
if a.kind == nkVarTuple:
|
||||||
if typ.kind != tyTuple:
|
if typ.kind != tyTuple:
|
||||||
localError(c.config, a.info, errXExpected, "tuple")
|
localError(c.config, a.info, errXExpected, "tuple")
|
||||||
elif int(length/2) != sonsLen(typ):
|
elif length-2 != sonsLen(typ):
|
||||||
localError(c.config, a.info, errWrongNumberOfVariables)
|
localError(c.config, a.info, errWrongNumberOfVariables)
|
||||||
b = newNodeI(nkVarTuple, a.info)
|
b = newNodeI(nkVarTuple, a.info)
|
||||||
newSons(b, length)
|
newSons(b, length)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue