summary refs log tree commit diff stats
path: root/tests/iter/t1550.nim
blob: 8ad96f0dac77b36e97727aa9b24b29ee75153e15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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