I didn't know you could do that with generics damn.

My initiation function needs a rework with your solution, previously I had:
    
    
    func newMatrix*[W, H](elements: array[W, array[H, float]]): Matrix[W, H] =
      result = elements
    
    
    Run

But with that I get the error: 
    
    
    C:\Users\Administrator\stack\dev\naytracer\src\naytracerpkg\matrix.nim(6, 
67) Error: cannot instantiate
     Matrix
    got: <static[type W](W), type H>
    but expected: <W, H>
    
    
    Run

Reply via email to