mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
Fix const tuple unpacking not working for variables > 2 (#10099)
This commit is contained in:
committed by
Andreas Rumpf
parent
58d293d6a9
commit
65a52ecebb
@@ -580,7 +580,7 @@ proc semConst(c: PContext, n: PNode): PNode =
|
||||
if a.kind == nkVarTuple:
|
||||
if typ.kind != tyTuple:
|
||||
localError(c.config, a.info, errXExpected, "tuple")
|
||||
elif int(length/2) != sonsLen(typ):
|
||||
elif length-2 != sonsLen(typ):
|
||||
localError(c.config, a.info, errWrongNumberOfVariables)
|
||||
b = newNodeI(nkVarTuple, a.info)
|
||||
newSons(b, length)
|
||||
|
||||
Reference in New Issue
Block a user