inlining of 'var openarray' iterators now work
This commit is contained in:
parent
f8ac84f863
commit
257b16ca34
3 changed files with 49 additions and 26 deletions
|
|
@ -1,16 +0,0 @@
|
|||
discard """
|
||||
file: "titer2.nim"
|
||||
msg: "internal error: not implemented: pass to var parameter"
|
||||
"""
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue