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
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
This is the documented behavior of isabstracttype
:
Determine whether type
T
was declared as an abstract type (i.e. using theabstract type
syntax). Note that this is not the negation ofisconcretetype(T).
[emphasis added]
It sounds like you want !isconcretetype
, e.g.
julia> !isconcretetype(IntOrString)
true
Thank you! That’s exactly what I wanted!)
Related doc issue: