Let’s say you have
julia> t = ([1, 2], ["a", "b"])
([1, 2], ["a", "b"])
julia> typeof(t)
Tuple{Array{Int64,1},Array{String,1}}
Let’s say I have a function that takes in a tuple of abstract arrays, and I really need the elements in the tuple to be abstract arrays. However the tuple has unknown length, so you can’t just write
julia> t isa Tuple{<:AbstractArray, <:AbstractArray}
true
Ideally I would write
julia> t isa Tuple{<:AbstractArray...}
But that syntax isn’t supported.
Even if I can’t use dispatch to let Julia know the type of this variable at compile time, it would still be nice to throw an error using run-time information if the argument inputted doesn’t match the contract I want.
Thank you