I don't quite understand what you are trying to achieve, something like this or 
no?
    
    
    import typetraits
    
    template underlyingType[T](a:seq[T]): typedesc =
       when T is seq:
         underlyingType(a[0])
       else:
         T
    
    let a = @[1,2,3]
    let b = @[a, a]
    
    echo underlyingType(a).name # prints int
    echo underlyingType(b).name # prints int
    

Reply via email to