summary refs log blame commit diff stats
path: root/tests/titer2.nim
blob: b9cdb53fe89a110f3f4a0c09f6839648c00d04ea (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                  
# Try to break the transformation pass:
iterator iterAndZero(a: var openArray[int]): int =
  for i in 0..len(a)-1:
    yield a[i]
    a[i] = 0

var x = [[1, 2, 3], [4, 5, 6]]
for y in iterAndZero(x[0]): write(stdout, $y)
#OUT 123