Why? isa([(x,1),(y,1)], Array{Tuple{Stuff,Number},1}) = false

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
4 Likes