I (think I) understand the issue in this
thread:
https://groups.google.com/forum/#!searchin/julia-users/AbstractString/julia-users/HBMDbnRTH9g/cuqa6hB8AQAJ
but I have the same problem with a keyword argument:
function g(s :: AbstractString; v :: Vector{AbstractString}=AbstractString
[])
println(s)
for e in v
println(v)
end
end
I need to dispatch on the optional argument `v`, so:
g{S <: AbstractString}(s :: AbstractString; v :: Vector{S}=Vector{S}[]) = g(
s, v=convert(Vector{AbstractString}, v))
but unfortunately:
julia> g("bla", ["foo", "bar"])
ERROR: MethodError: `g` has no method matching g(::ASCIIString, ::Array{
ASCIIString,1})
Closest candidates are:
g(::AbstractString)
Moreover,
julia> g("boo")
ERROR: UndefVarError: S not defined
Any ideas?