Skip to content

Commit

Permalink
[Test] avoid scanning Base twice for ambiguities (JuliaLang#43694)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored and LilithHafner committed Feb 22, 2022
1 parent cd552cd commit e15a442
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stdlib/Test/src/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ function detect_ambiguities(mods::Module...;
end
end
work = Base.loaded_modules_array()
filter!(mod -> mod === parentmodule(mod), work) # some items in loaded_modules_array are not top modules (really just Base)
while !isempty(work)
mod = pop!(work)
for n in names(mod, all = true)
Expand Down Expand Up @@ -1754,8 +1755,8 @@ function detect_unbound_args(mods...;
mods = collect(mods)::Vector{Module}
function examine(mt::Core.MethodTable)
for m in Base.MethodList(mt)
has_unbound_vars(m.sig) || continue
is_in_mods(m.module, recursive, mods) || continue
has_unbound_vars(m.sig) || continue
tuple_sig = Base.unwrap_unionall(m.sig)::DataType
if Base.isvatuple(tuple_sig)
params = tuple_sig.parameters[1:(end - 1)]
Expand All @@ -1769,6 +1770,7 @@ function detect_unbound_args(mods...;
end
end
work = Base.loaded_modules_array()
filter!(mod -> mod === parentmodule(mod), work) # some items in loaded_modules_array are not top modules (really just Base)
while !isempty(work)
mod = pop!(work)
for n in names(mod, all = true)
Expand Down

0 comments on commit e15a442

Please sign in to comment.