diff options
Diffstat (limited to 'tests/accept/run/titer2.nim')
-rw-r--r-- | tests/accept/run/titer2.nim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/accept/run/titer2.nim b/tests/accept/run/titer2.nim new file mode 100644 index 000000000..b9cdb53fe --- /dev/null +++ b/tests/accept/run/titer2.nim @@ -0,0 +1,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 + |