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

@@ -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