parent
64ffa17f0f
commit
a5f02cac85
2 changed files with 31 additions and 11 deletions
|
|
@ -213,3 +213,24 @@ block t2023_objiter:
|
|||
|
||||
var o = init()
|
||||
echo(o.iter())
|
||||
|
||||
block:
|
||||
# bug #13417
|
||||
|
||||
var effectCounterP1 = 0
|
||||
|
||||
proc p1(): seq[int] =
|
||||
inc effectCounterP1
|
||||
@[1,2]
|
||||
|
||||
iterator ip1(v: openArray[int]): auto =
|
||||
for x in v:
|
||||
yield x
|
||||
|
||||
var effectCounterLoop = 0
|
||||
|
||||
for x in ip1(p1()):
|
||||
inc effectCounterLoop
|
||||
|
||||
doAssert effectCounterP1 == 1
|
||||
doAssert effectCounterLoop == 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue