Skip to content

Commit

Permalink
fix #52986, regression in @doc of macro without REPL loaded (#55795)
Browse files Browse the repository at this point in the history
fix #52986

(cherry picked from commit 4045e7b)
  • Loading branch information
JeffBezanson authored and KristofferC committed Sep 24, 2024
1 parent 9db412b commit b0bf394
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/docs/Docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ function _doc(binding::Binding, sig::Type = Union{})
for msig in multidoc.order
sig <: msig && return multidoc.docs[msig]
end
# if no matching signatures, return first
if !isempty(multidoc.docs)
return first(values(multidoc.docs))
end
end
end
return nothing
Expand Down
1 change: 1 addition & 0 deletions test/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Base.Docs: meta, @var, DocStr, parsedoc

# check that @doc can work before REPL is loaded
@test !startswith(read(`$(Base.julia_cmd()) -E '@doc sin'`, String), "nothing")
@test !startswith(read(`$(Base.julia_cmd()) -E '@doc @time'`, String), "nothing")

using Markdown
using REPL
Expand Down

0 comments on commit b0bf394

Please sign in to comment.