Hello,

Although using generics works, this is not the only solutions, you could also 
use explicit casting, like that :
    
    
    var myVideo = TVideo()
    var myVideoList = @[myVideo]
    setNewDims(cast[seq[TMedia]](myVideoList))
    
    
    Run

If you use generics, it can be a good practice to restrain your usage:
    
    
    proc setNewDims[T: TMedia](arr: seq[T])
    
    
    Run

However, I don't know in that case if generics or explicit casting is better. I 
tend to use explicit casting (And I think it is a shame the compiler can't do 
implicit casting in that case, but maybe it's in the todo list)

Reply via email to