* Fix bug in freshVarForClosureIter. Fixes #18474. freshVarForClosureIter was returning non-fresh symbols sometimes. Fixed by making addField return the generated PSym. * remove discardable Co-authored-by: Nick Smallbone <nick@smallbone.se>
This commit is contained in:
parent
c3f03cfa5d
commit
83dabb69ae
4 changed files with 35 additions and 21 deletions
|
|
@ -21,6 +21,15 @@ discard """
|
|||
2
|
||||
70
|
||||
0
|
||||
(1, 1)
|
||||
(1, 2)
|
||||
(1, 3)
|
||||
(2, 1)
|
||||
(2, 2)
|
||||
(2, 3)
|
||||
(3, 1)
|
||||
(3, 2)
|
||||
(3, 3)
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
@ -152,3 +161,12 @@ var love = iterator: int {.closure.} =
|
|||
|
||||
for i in love():
|
||||
echo i
|
||||
|
||||
# bug #18474
|
||||
iterator pairs(): (int, int) {.closure.} =
|
||||
for i in 1..3:
|
||||
for j in 1..3:
|
||||
yield (i, j)
|
||||
|
||||
for pair in pairs():
|
||||
echo pair
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue