Skip to content

Commit

Permalink
fix typejoin docstring (JuliaLang#46018)
Browse files Browse the repository at this point in the history
Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
  • Loading branch information
2 people authored and Francesco Fucci committed Aug 11, 2022
1 parent 9c61dfe commit 31eb567
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions base/promotion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
## type join (closest common ancestor, or least upper bound) ##

"""
typejoin(T, S)
typejoin(T, S, ...)
Return the closest common ancestor of `T` and `S`, i.e. the narrowest type from which
they both inherit.
Return the closest common ancestor of types `T` and `S`, i.e. the narrowest type from which
they both inherit. Recurses on additional varargs.
# Examples
```jldoctest
julia> typejoin(Int, Float64)
Real
julia> typejoin(Int, Float64, ComplexF32)
Number
```
"""
typejoin() = Bottom
typejoin(@nospecialize(t)) = t
Expand Down

0 comments on commit 31eb567

Please sign in to comment.