Skip to content

Commit e1739aa

Browse files
t-bltgaviatesk
andauthored
fix typejoin docstring (#46018)
Co-authored-by: Shuhei Kadowaki <[email protected]>
1 parent 94e4082 commit e1739aa

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

base/promotion.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
## type join (closest common ancestor, or least upper bound) ##
44

55
"""
6-
typejoin(T, S)
6+
typejoin(T, S, ...)
77
8-
Return the closest common ancestor of `T` and `S`, i.e. the narrowest type from which
9-
they both inherit.
8+
Return the closest common ancestor of types `T` and `S`, i.e. the narrowest type from which
9+
they both inherit. Recurses on additional varargs.
10+
11+
# Examples
12+
```jldoctest
13+
julia> typejoin(Int, Float64)
14+
Real
15+
16+
julia> typejoin(Int, Float64, ComplexF32)
17+
Number
18+
```
1019
"""
1120
typejoin() = Bottom
1221
typejoin(@nospecialize(t)) = t

0 commit comments

Comments
 (0)