Skip to content

Commit b07594d

Browse files
Revert "explain method signatures for Any arguments (#36673)" (#36696)
This reverts commit 35f120f.
1 parent 6c5527c commit b07594d

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

doc/src/manual/methods.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,13 @@ 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-
193187
julia> f("foo", 1)
194188
Whoa there, Nelly.
195189
```
196190

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

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-
203194
Although it seems a simple concept, multiple dispatch on the types of values is perhaps the single
204195
most powerful and central feature of the Julia language. Core operations typically have dozens
205196
of methods:

0 commit comments

Comments
 (0)