From d57200bc6fc5d5964713e5af36e5553c6b85a8ea Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Sat, 13 Jan 2024 19:00:55 +0800 Subject: [PATCH] fixes #15924; Tuple destructuring is broken with closure iterators (#23205) fixes #15924 (cherry picked from commit 8484abc2e498bd9738097c06362d442c615a8264) --- compiler/lambdalifting.nim | 13 ++++++++----- tests/iter/titer.nim | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 02c3eefff7360..e56f6e8d7525d 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -989,12 +989,15 @@ proc liftForLoop*(g: ModuleGraph; body: PNode; idgen: IdGenerator; owner: PSym): # gather vars in a tuple: var v2 = newNodeI(nkLetSection, body.info) var vpart = newNodeI(if body.len == 3: nkIdentDefs else: nkVarTuple, body.info) - for i in 0..