Is union abstract type?

Despite the fact that the documentation says that union is an abstract type, the isabstracttype() function returns false:

IntOrString = Union{Int,AbstractString}
isabstracttype(IntOrString)
false
1 Like

This is the documented behavior of isabstracttype:

Determine whether type T was declared as an abstract type (i.e. using the abstract type syntax). Note that this is not the negation of isconcretetype(T). [emphasis added]

It sounds like you want !isconcretetype, e.g.

julia> !isconcretetype(IntOrString)
true
6 Likes

Thank you! That’s exactly what I wanted!)

1 Like

Related doc issue:

1 Like