Files
Nim/tests/system
metagn 9a6230ee5a wrap fields iterations in if true scope [backport] (#24343)
fixes #24338

When unrolling each iteration of a `fields` iterator, the compiler only
opens a new scope for semchecking, but doesn't generate a node that
signals to the codegen that a new scope should be created. This causes
issues for reused template instantiations that reuse variable symbols
between each iteration, which causes the codegen to generate multiple
declarations for them in the same scope (regardless of `inject` or
`gensym`). To fix this, we wrap the unrolled iterations in an `if true:
body` node, which both opens a new scope and doesn't interfere with
`break`.

(cherry picked from commit ca5df9ab25)
2025-01-14 07:48:01 +01:00
..
2018-12-11 21:23:22 +01:00
2019-10-03 18:36:18 +02:00
2022-09-23 13:05:05 +02:00
2023-07-29 10:57:03 +02:00
2023-07-29 10:57:03 +02:00
2019-07-06 21:20:16 +02:00
2020-12-27 14:45:57 +01:00
2020-04-21 15:05:21 +02:00
2023-04-08 11:42:17 +02:00