Skip to content

Commit a6d9df7

Browse files
authored
Only warn in helpmode on successful nonpublic access (#51346)
1 parent a75c709 commit a6d9df7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

stdlib/REPL/src/docview.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ struct Logged{F}
166166
collection::Set{Pair{Module,Symbol}}
167167
end
168168
function (la::Logged)(m::Module, s::Symbol)
169-
m !== la.mod && !Base.ispublic(m, s) && push!(la.collection, m => s)
169+
m !== la.mod && Base.isdefined(m, s) && !Base.ispublic(m, s) && push!(la.collection, m => s)
170170
la.f(m, s)
171171
end
172172
(la::Logged)(args...) = la.f(args...)

stdlib/REPL/test/docview.jl

+3
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,6 @@ module InternalWarningsTests
132132
@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"
133133
end
134134
end
135+
136+
# Issue #51344, don't print "internal binding" warning for non-existent bindings.
137+
@test string(eval(REPL.helpmode("Base.no_such_symbol"))) == "No documentation found.\n\nBinding `Base.no_such_symbol` does not exist.\n"

0 commit comments

Comments
 (0)