How to specify a type of Vector, SVector, OR Tuple of a certain type, such as Int?

You probably want Union{AbstractVector{T}, Tuple{Vararg{T}}} where {T}. If you need to write this more often, you can also create an alias:

VectorLike{T} = Union{AbstractVector{T}, Tuple{Vararg{T}}}

and then dispatch on that.

1 Like