vla
vla copied to clipboard
invalid pragma: unchecked
Using vla with Nim devel (GIT 2021-02-22) doesn't compile
vla.nim(6, 19) Error: invalid pragma: unchecked
Please try it now.
Thanks! In addition to your patch, I have applied the following patch
template asOpenArray*[T](a: VarLengthArray[T]): openarray[T] =
- cast[seq[type(a[0])]](a)
+ toOpenArray(addr a.data[0],0,a.len)
using the new? toOpenArray
function from system.nim
I am pondering about adding a VarLengthArray
which lives on the heap.
Probably one has to use create
and dealloc
Thanks, I'll make that change as soon as I have some time. Also, it's come to my attention that the test suite is deficient. Oh, BTW, PRs are welcome!