Defining a subclass

Sorry, I didn’t use the correct words: Complex is not an abstract type, but it is a parametric type. That means that it is not either a concrete type, as you can see when you create actual complex numbers:

julia> typeof(1+1im)
Complex{Int64}

julia> typeof(1.0 + 1.0im)
ComplexF64 (alias for Complex{Float64})

None of them is “just” Complex: the concrete types also carry information of the type of numbers contained (real and imaginary parts).

Now, about the notation Vector{<:Complex}, the first few posts of the following discussion can help you (the discussion is about the abstract type Number, not about the parametric type Complex, but the situation is analogous):

1 Like