From 31eb567155500857671e8e1b371a95904af56a89 Mon Sep 17 00:00:00 2001 From: t-bltg Date: Mon, 18 Jul 2022 12:27:38 +0200 Subject: [PATCH] fix `typejoin` docstring (#46018) Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> --- base/promotion.jl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/base/promotion.jl b/base/promotion.jl index 3dc49c8eaf1b6..d64ace818bb86 100644 --- a/base/promotion.jl +++ b/base/promotion.jl @@ -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