Why does this not work ?
type
PodBvector* [T;S:static[int]] = object
size: int
num_blocks: int
max_blocks: int
blocks: seq[array[1 shl S,T]]
block_ptr_inc: int
proc createPodBvector* [T;S:static[int]]() : PodBvector[T,S] =
result.block_ptr_inc = S
var xx:PodBvector[int, 6]
xx = createPodBvector() # fails with cannot instantiate T
xx = createPodBvector[int, 6]() # fails here with: error type expected
Now I tried it in another way and got a new error:
proc createPodBvector* [T;S:static[int]](self: var PodBvector[T,S]) =
self.block_ptr_inc = S # internal error: cannot generate code for: S
var xx:PodBvector[int, 6]
createPodBvector(xx)
seems that generics with static types are broken. I will create an issue on github
Edit: oops - should have looked at the issues, its already there :)