make nested custom seqs work

This commit is contained in:
Andreas Rumpf 2017-10-19 13:24:24 +02:00
commit 4f633dde64
3 changed files with 21 additions and 4 deletions

View file

@ -8,7 +8,14 @@ discard """
89
90
90
after 1 1'''
0 0 1
0 1 2
0 2 3
1 0 4
1 1 5
1 2 6
1 3 7
after 6 6'''
cmd: '''nim c --newruntime $file'''
"""
@ -127,5 +134,10 @@ proc main =
for i in 0 ..< s.len:
echo s[i]
var nested = createSeq(createSeq(1, 2, 3), createSeq(4, 5, 6, 7))
for i in 0 ..< nested.len:
for j in 0 ..< nested[i].len:
echo i, " ", j, " ", nested[i][j]
main()
echo "after ", allocCount, " ", deallocCount