fixes #21138; closure func used in the loop (#25196)

fixes #21138
This commit is contained in:
ringabout
2025-09-27 11:54:22 +08:00
committed by GitHub
parent f4497c6158
commit cc49bf07fe
2 changed files with 16 additions and 1 deletions

View File

@@ -329,7 +329,7 @@ proc introduceNewLocalVars(c: PTransf, n: PNode): PNode =
if a.kind == nkSym:
n[1] = transformSymAux(c, a)
return n
of nkProcDef: # todo optimize nosideeffects?
of nkProcDef, nkFuncDef, nkMethodDef, nkConverterDef: # todo optimize nosideeffects?
result = newTransNode(n)
let x = newSymNode(copySym(n[namePos].sym, c.idgen))
c.transCon.mapping[n[namePos].sym.itemId] = x