Skip to content

Commit

Permalink
Only warn in helpmode on successful nonpublic access (#51346)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner committed Oct 24, 2023
1 parent a75c709 commit a6d9df7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/REPL/src/docview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ struct Logged{F}
collection::Set{Pair{Module,Symbol}}
end
function (la::Logged)(m::Module, s::Symbol)
m !== la.mod && !Base.ispublic(m, s) && push!(la.collection, m => s)
m !== la.mod && Base.isdefined(m, s) && !Base.ispublic(m, s) && push!(la.collection, m => s)
la.f(m, s)
end
(la::Logged)(args...) = la.f(args...)
Expand Down
3 changes: 3 additions & 0 deletions stdlib/REPL/test/docview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ module InternalWarningsTests
@test docstring("A.B3") == "No docstring or readme file found for public module `$(@__MODULE__).A.B3`.\n\nModule does not have any public names.\n"
end
end

# Issue #51344, don't print "internal binding" warning for non-existent bindings.
@test string(eval(REPL.helpmode("Base.no_such_symbol"))) == "No documentation found.\n\nBinding `Base.no_such_symbol` does not exist.\n"

0 comments on commit a6d9df7

Please sign in to comment.