From 65a52ecebb98774777f1792f5696b211c51926af Mon Sep 17 00:00:00 2001 From: Neelesh Chandola Date: Thu, 27 Dec 2018 05:20:33 +0530 Subject: [PATCH] Fix const tuple unpacking not working for variables > 2 (#10099) --- compiler/semstmts.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)