type
        ## Define a generic vector type with a fixed size and element type.
        Vec[N: static[int], V] = array[N, V]
    
    
    echo `[]`(array[3, float]([1.0, 2.0, 3.0]), 1) # 2.0
    echo `[]`(Vec[3, float]([1.0, 2.0, 3.0]), 1) # 2.0
    
    
    Run

This code works fine, but when I define some distinct type of Vec[N, V] and 
borrow the base access operator I get this error: "no symbol to borrow from 
found".
    
    
    type Color = distinct Vec[3, float]
    proc `[]`(a: Color, i: int): float {.borrow.}
    
    
    Run

Reply via email to