Skip to content

Commit

Permalink
Document supertype(T::UnionAll) (#54419)
Browse files Browse the repository at this point in the history
Fixes #54286.
  • Loading branch information
xlxs4 committed May 10, 2024
1 parent 0c6ee07 commit 4793328
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,19 @@ Supertype operator, equivalent to `T2 <: T1`.
(>:)(@nospecialize(a), @nospecialize(b)) = (b <: a)

"""
supertype(T::DataType)
supertype(T::Union{DataType, UnionAll})
Return the supertype of DataType `T`.
Return the direct supertype of type `T`.
`T` can be a [`DataType`](@ref) or a [`UnionAll`](@ref) type. Does not support
type [`Union`](@ref)s. Also see info on [Types](@ref man-types).
# Examples
```jldoctest
julia> supertype(Int32)
Signed
julia> supertype(Vector)
DenseVector (alias for DenseArray{T, 1} where T)
```
"""
supertype(T::DataType) = (@_total_meta; T.super)
Expand Down

0 comments on commit 4793328

Please sign in to comment.