Further explanation for a newbie: the key reason is that Array
is not covariant (or more generally, " Julia’s type parameters are invariant"; see the link above).
A more concise example to show the invariance:
julia> 1 isa Real
true
julia> [1]
1-element Vector{Int64}:
1
julia> [1] isa Vector{Real}
false
julia> Int64 <: Real
true
julia> [1] isa Vector{<:Real} # <: means any subtype of Real
true