Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/methodshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function functionloc(@nospecialize(f))
end
end
if length(mt) > 1
error("function has multiple methods; please specify a type signature")
error("function has multiple methods; please specify a type signature:\n" * string(mt))
end
return functionloc(first(mt))
end
Expand Down
8 changes: 5 additions & 3 deletions stdlib/InteractiveUtils/src/editless.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ end

"""
edit(function, [types])
edit(function, [index])
edit(module)

Edit the definition of a function, optionally specifying a tuple of types to indicate which
method to edit. For modules, open the main source file. The module needs to be loaded with
`using` or `import` first.
Edit the definition of a function, optionally specifying a tuple of types, or method
index, to indicate which method to edit. For modules, open the main source file.
The module needs to be loaded with `using` or `import` first.

!!! compat "Julia 1.1"
`edit` on modules requires at least Julia 1.1.
Expand All @@ -222,6 +223,7 @@ To ensure that the file can be opened at the given line, you may need to call
"""
edit(f) = edit(functionloc(f)...)
edit(f, @nospecialize t) = edit(functionloc(f,t)...)
edit(f::Function, index::Integer) = edit(methods(f).ms[index])
edit(file, line::Integer) = error("could not find source file for function")
edit(m::Module) = edit(pathof(m))

Expand Down