julia> c = [Dict("a"=>1), Dict("b"=>2)]
2-element Array{Dict{ASCIIString,Int64},1}:
 Dict("a"=>1)
 Dict("b"=>2)

julia> myfunc(c)
ERROR: MethodError: `myfunc` has no method matching 
myfunc(::Array{Dict{ASCIIString,Int64},1})

Here, Julia is complaining that your argument is too-well typed :-). (See 
invariance/covariance/contravariance in the manual.)

The version I posted handles both of them.

Best,
--Tim

On Thursday, July 14, 2016 9:54:08 PM CDT 'Greg Plowman' via julia-users 
wrote:
> > What about the following?
> 
> myfunc(vec::Vector{Dict{ASCIIString}}) = 1
> a = [ Dict("a"=>1), Dict("b"=>1.0) ]
> b = [ Dict(1=>:hello), Dict(2=>:world) ]
> 
> 
> julia> myfunc(a)
> 1
> 
> julia> myfunc(b)
> ERROR: MethodError: `myfunc` has no method matching
> myfunc(::Array{Dict{Int64,Symbol},1})


Reply via email to