I am clearly missing something fundamental here. How can I change the second method of my function to accept c? Additionally, I would really prefer to use AbstractArray instead of AbstractVector as the type so as not to restrict the dimension either, but I wanted to cut down on potential sources of error.
function f(x::AbstractVector{Int})
println(x)
end # f (generic function with 1 method)
function f(x::AbstractVector{AbstractVector{Int}})
for i in x
println(i)
end
end # f (generic function with 2 methods)
a=[1,2,3] # 3-element Array{Int64,1}:
b=[4,5,6] # 3-element Array{Int64,1}:
c=[a,b] # 2-element Array{Array{Int64,1},1}:
typeof(a) <: AbstractVector{Int} # true
typeof(c) <: AbstractVector{AbstractVector{Int}} # false
f(a) # [1, 2, 3]
f(c) # ERROR: MethodError: no method matching f(::Array{Array{Int64,1},1})