diff options
author | Neelesh Chandola <neelesh.chandola@outlook.com> | 2018-12-27 05:20:33 +0530 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-12-27 00:50:33 +0100 |
commit | 65a52ecebb98774777f1792f5696b211c51926af (patch) | |
tree | 45dbf27e0ac936cfc73c4c1a99eaa25d040fbac4 /compiler/semstmts.nim | |
parent | 58d293d6a98b56ed4b309491f09492618c3fa9ec (diff) | |
download | Nim-65a52ecebb98774777f1792f5696b211c51926af.tar.gz |
Fix const tuple unpacking not working for variables > 2 (#10099)
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r-- | compiler/semstmts.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 9016fed2b..04991193c 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -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) |