mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
@@ -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
|
||||
|
||||
@@ -145,3 +145,18 @@ proc main123() =
|
||||
discard
|
||||
|
||||
main123()
|
||||
|
||||
# bug #21138
|
||||
iterator ubi(): int =
|
||||
when nimvm:
|
||||
yield 0
|
||||
else:
|
||||
yield 0
|
||||
|
||||
block:
|
||||
for k in ubi():
|
||||
func e() {.closure.} = discard
|
||||
|
||||
static:
|
||||
for k in ubi():
|
||||
func e() {.closure.} = discard
|
||||
|
||||
Reference in New Issue
Block a user