Skip to content

Commit 003c9d4

Browse files
committed
more readme fixes
1 parent 38218c7 commit 003c9d4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Typically, you'll do this by enforcing a return type on a function:
8686
function foo() :: Either{Int, Float64}
8787
# Randomly return either a Left(1) or a Right(2.0)
8888
rand(Bool) ? Left(1) : Right(2.0)
89-
end;
89+
end
9090
```
9191
```julia
9292
julia> foo()
@@ -99,11 +99,10 @@ This is particularly useful because in this case `foo` is
9999
[type stable](https://docs.julialang.org/en/v1/manual/performance-tips/#Write-%22type-stable%22-functions)!
100100

101101
``` julia
102-
julia> Base.return_types(foo, Tuple{})
103-
1-element Vector{Any}:
104-
Either{Int64, Float64, 8, 0, UInt64}
102+
julia> Core.Compiler.return_type(foo, Tuple{})
103+
Either{Int64, Float64}
105104

106-
julia> isconcretetype(ans[1])
105+
julia> isconcretetype(ans)
107106
true
108107
```
109108
Note that unlike `Union{A, B}`, `A <: Either{A,B}` is false, and `Either{A, A}` is distinct from `A`.

0 commit comments

Comments
 (0)