Checking whether a variable is of a supertype

The section you mention basically only mentions isa, which also works for this purpose. You can just:

julia> a=1; M = rand(Int64, 3, 4);

julia> isa(M, AbstractMatrix)
true

julia> isa(a, Integer)
true
3 Likes