Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #52986, regression in @doc of macro without REPL loaded #55795

Merged
merged 1 commit into from
Sep 19, 2024
Merged
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
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