close #1550 add testcase (#16640)

This commit is contained in:
flywind
2021-01-08 07:42:38 -06:00
committed by GitHub
parent add1ccb6cb
commit 38b8d080f2

20
tests/iter/t1550.nim Normal file
View File

@@ -0,0 +1,20 @@
type
A[T] = iterator(x: T): T {.gcsafe, closure.}
iterator aimp[T](x: T): T {.gcsafe, closure.} =
var total = 0
while (total < 100):
yield total
total += x
iterator bimp(y: A[int], z:int): int {.gcsafe, closure.} =
for i in y(z):
yield i
for x in aimp[int](3):
discard x
var y = aimp[int]
var z = bimp
for x in z(y, 1):
discard x