From 00d518121952d40af379da26e5c26fbe39acff2c Mon Sep 17 00:00:00 2001 From: Adam Wheeler Date: Wed, 4 Dec 2024 15:42:32 -0500 Subject: [PATCH] also filter on isbindingresolved --- stdlib/REPL/src/REPL.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/REPL/src/REPL.jl b/stdlib/REPL/src/REPL.jl index 24f10c5b756ee..4e8b44c6ff374 100644 --- a/stdlib/REPL/src/REPL.jl +++ b/stdlib/REPL/src/REPL.jl @@ -77,8 +77,8 @@ function _UndefVarError_warnfor(io::IO, modules, var::Symbol) # the parentmodule in which the variable is defined to_warn_about = Dict{Module, Vector{Module}}() for m in modules - # only warn if exported or public TODO why did this used to check isbindingresolved? - if !Base.isexported(m, var) && !Base.ispublic(m, var) + # only warn if binding is resolved and exported or public + if !Base.isbindingresolved(m, var) || (!Base.isexported(m, var) && !Base.ispublic(m, var)) continue end warned = true @@ -109,7 +109,7 @@ function _UndefVarError_warnfor(io::IO, modules, var::Symbol) end print(io, "\n - Also $how_available $m") if !isdefined(active_mod, Symbol(m)) - print(io, ", which would need to be imported in $active_mod") + print(io, " (loaded but not imported in $active_mod)") end print(io, ".") end