Subtyping directly in parametrics Types

Can you explain how I should understand?

Ignoring the Vector part first, Union{Missing, <:Real} is an iterated union of unions. It is equal (==) to the full form Union{Missing, T} where T <: Real and the simplified Union{Missing, Real}. That’s just how unions of unions simplify to a union, and sometimes Julia will do that simplification automatically so watch out for apparent discrepancies like this:

julia> Union{Union{Missing, <:Real}, Integer}
Union{Missing, Real}

Vector{Union{Missing, Real}} is a concrete type with an abstract type parameter, and a concrete type cannot be subtyped. Vector{Union{Missing, T}} where T <: Real is an iterated union of an infinite number of concrete Vector types, including Vector{Union{Missing, Int64}} and Vector{Union{Missing, Real}}. Iterated unions are abstract types, and abstract types can be subtyped.

<:Union{Missing,Real} also works. Documentation should have some particular explanation for this type of use.

I don’t think the equivalency of unions of unions to a simpler union is documented, and it’s hard to find a good way to explain that. In simpler cases it’s like set theory, but not everything is that simple. In practice, it’s more readable to write down flat unions instead of nesting them.

The inability of concrete types to subtype each other is documented in the introduction of the Types section of the Manual, and the invariance of type parameters (in short, T<:U does not imply V{T}<:V{U}) and superficial covariance of iterated unions (T<:U does imply V{T} <: V{<:U}) is documented in the Parametric Types subsection.

It also occurs to me that you might have had a wrong expectation of the V{<:U} shorthand for V{X} where {X<:U}. Visually, if you just placed the where clause into the curly braces, you might have thought

Vector{Union{Missing, T}} where T <: Real

becomes

Vector{Union{Missing, <:Real}}

but the shorthand can only work across 1 layer of curly braces, not 2. This attempt made an entirely different type, which we can see if we go back the other way across 1 layer of curly braces:

Vector{Union{Missing, U} where U <: Real}

As far as I know, there is no shorthand version of the first type. That’s why the shorthand is only a shorthand, not the primary syntax.