From ce5909ceca8e0df00407ad39bd0e2763890b185d Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Wed, 27 Apr 2022 22:51:38 +0400 Subject: [PATCH] doc: use `isa` instead of :: in the docstring for Union (#45104) --- base/docs/basedocs.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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