This is because of invariance:

"
This last point is very important:

Even though Float64 <: Real we DO NOT have Point{Float64} <: Point{Real}.

In other words, in the parlance of type theory, Julia’s type parameters
are invariant, rather than being covariant (or even contravariant). 
"

http://docs.julialang.org/en/latest/manual/types/#parametric-composite-types

On Mon, 2014-07-07 at 12:50, [email protected] 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}?

-- 

Reply via email to