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
  • Loading branch information
JeffBezanson authored Sep 19, 2024
1 parent 58b239c commit 4045e7b
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 @@ -577,6 +577,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 4045e7b

Please sign in to comment.