* fix #13417

* add test
This commit is contained in:
Arne Döring 2020-03-22 20:03:51 +01:00 • committed by GitHub
commit a5f02cac85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 11 deletions

View file

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