This is a FAQ and covered in the manual, in the section on parametric types.
If you don't find that description clear, please edit it to make it better.
Short answer: use a function signature like this
function myfunc{S<:String}(a::Array{S,1})
Best,
--Tim
On Monday, July 07, 2014 04:50:14 AM RecentConvert wrote:
> I have a function which is suppose to take a variety of inputs, one of them
> is an array of file names. The problem I'm running into is that sending in
> an ASCII string array, Array{ASCIIString,1}, to a function with a more
> general definition, Array{String,1}, it give me a method error.
>
> julia> y = ["Hello","cruel","world"] 3-element Array{ASCIIString,1}:
> "Hello"
> "cruel"
> "world"
>
> julia> isa(y,Array{ASCIIString,1}) true
>
> julia> isa(y,Array{String,1})
> false
>
> julia> isa(y[1],String) true
>
>
> julia> isa(y[1],ASCIIString)
> true
>
>
> Why won't Array{ASCIIString,1} qualify as a Array{String,1}?