Skip to content

Commit

Permalink
fix #52986, regression in @doc of macro without REPL loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Sep 17, 2024
1 parent 48ddd2d commit 0162588
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 0162588

Please sign in to comment.