Skip to content

Commit

Permalink
Update methods.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Oct 31, 2023
1 parent ad03d93 commit 6478d83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/src/manual/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,11 @@ myappend (generic function with 1 method)
The type parameter `T` in this example ensures that the added element `x` is a subtype of the
existing eltype of the vector `v`.
The `where` keyword introduces a list of those constraints after the method signature definition.
This works the same for one-line definitions, as seen above, and must appear _after_ the [return
This works the same for one-line definitions, as seen above, and must appear _before_ the [return
type declaration](@ref man-functions-return-type), if present, as illustrated below:

```jldoctest
julia> (myappend(v::Vector{T}, x::T) where {T})::Vector = [v..., x]
julia> (myappend(v::Vector{T}, x::T)::Vector) where {T} = [v..., x]
myappend (generic function with 1 method)
julia> myappend([1,2,3],4)
Expand Down

0 comments on commit 6478d83

Please sign in to comment.