I would like to specify the size of an array inside a object at compiletime 
with generics, like:
    
    
    type
      Matrix0[x:int] = object
        v: array[x, float64]
        w: int # width of matrix
        h: int
    
    var a: Matrix0[6]
    
    
    Run

but the compiler says
    
    
    fatal.nim(49)            sysFatal
    Error: unhandled exception: int128.nim(72, 11) `arg.sdata(2) == 0` out of 
range [AssertionError]
    exit status 1
    
    
    Run

What am I doing wrong? Is it a compiler-bug? Is there a workaround?

Reply via email to