diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index c102a3b2ce426..8cb5c021fabc9 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -2523,14 +2523,14 @@ union [`Union{}`](@ref) is the bottom type of Julia. julia> IntOrString = Union{Int,AbstractString} Union{Int64, AbstractString} -julia> 1 :: IntOrString -1 +julia> 1 isa IntOrString +true -julia> "Hello!" :: IntOrString -"Hello!" +julia> "Hello!" isa IntOrString +true -julia> 1.0 :: IntOrString -ERROR: TypeError: in typeassert, expected Union{Int64, AbstractString}, got a value of type Float64 +julia> 1.0 isa IntOrString +false ``` """ Union