Indeed it is partly my own bug, I call in generator script gen.nim
unintentionally something like
var s = newSeq[int]()
try:
for x in combinations(s, 1):
echo x
except:
discard
Run
Of course makes no sense with empty seq, but works fine with default gc but
gives this error with ARC:
Error: unhandled exception:
/home/stefan/gintrotest/tests/combinatorics.nim(69, 10) `
0 <= k and
k <= n` [AssertionError]
Error: execution of an external program failed:
'/home/stefan/gintrotest/tests/combinatorics '
Run
First when such an error occured in my gen.nim script the error messages was
unfortunately useless like
Traceback (most recent call last)
/home/stefan/gintrotest/tests/gen.nim(2595) gen
/home/stefan/gintrotest/tests/gen.nim(2530) launch
/home/stefan/Nim/lib/system/fatal.nim(34) main
/home/stefan/Nim/lib/system/fatal.nim(45) sysFatal
/home/stefan/Nim/lib/system/fatal.nim(33) sysFatal
Error: unhandled exception: index out of bounds, the container is empty
[IndexError]
Run
Can someone give me a hint why I get even with default GC:
$ nim c -r combinatorics.nim
/home/stefan/gintrotest/tests/combinatorics.nim(171, 30) Error: attempting
to call routine: 'permutations'
found 'combinatorics.permutations(s: openArray[T]) [declared in
/home/stefan/gintrotest/tests/combinatorics.nim(19, 10)]' of kind 'iterator'
Run
There must be something wrong in the code after "when is mainModule:" with the
testings templates, but I have no idea.