You need static int
    
    
    type
      MatchPool[N: static int] = object # Here, N is an integer
        vals: array[N, int]
    
    var mp = MatchPool[3](vals: [2, 4, 1])
    
    
    Run

If N is not known at compile-time you have to use a seq (or a custom container 
with a runtime length) 
    
    
    type
      MatchPool = object # Here, N is an integer
        vals: seq[int]
    
    var mp = MatchPool(vals: @[2, 4, 1])
    
    
    Run

Reply via email to