Skip to content

Commit 0fd5833

Browse files
authored
Use Documenter 0.25.2 and reenable some doctests (#37110)
1 parent fa1d1c8 commit 0fd5833

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

doc/Manifest.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ version = "0.8.2"
1919

2020
[[Documenter]]
2121
deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
22-
git-tree-sha1 = "1c593d1efa27437ed9dd365d1143c594b563e138"
22+
git-tree-sha1 = "fb1ff838470573adc15c71ba79f8d31328f035da"
2323
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
24-
version = "0.25.1"
24+
version = "0.25.2"
2525

2626
[[DocumenterLaTeX]]
2727
deps = ["Documenter", "Test"]

doc/src/manual/methods.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ f (generic function with 2 methods)
165165
This output tells us that `f` is a function object with two methods. To find out what the signatures
166166
of those methods are, use the [`methods`](@ref) function:
167167

168-
```julia-repl
168+
```jldoctest fofxy
169169
julia> methods(f)
170170
# 2 methods for generic function "f":
171171
[1] f(x::Float64, y::Float64) in Main at none:1
@@ -184,13 +184,22 @@ meaning that it is unconstrained since all values in Julia are instances of the
184184
julia> f(x,y) = println("Whoa there, Nelly.")
185185
f (generic function with 3 methods)
186186
187+
julia> methods(f)
188+
# 3 methods for generic function "f":
189+
[1] f(x::Float64, y::Float64) in Main at none:1
190+
[2] f(x::Number, y::Number) in Main at none:1
191+
[3] f(x, y) in Main at none:1
192+
187193
julia> f("foo", 1)
188194
Whoa there, Nelly.
189195
```
190196

191197
This catch-all is less specific than any other possible method definition for a pair of parameter
192198
values, so it will only be called on pairs of arguments to which no other method definition applies.
193199

200+
Note that in the signature of the third method, there is no type specified for the arguments `x` and `y`.
201+
This is a shortened way of expressing `f(x::Any, y::Any)`.
202+
194203
Although it seems a simple concept, multiple dispatch on the types of values is perhaps the single
195204
most powerful and central feature of the Julia language. Core operations typically have dozens
196205
of methods:

0 commit comments

Comments
 (0)