Skip to content

Commit b0fbc5c

Browse files
authored
[Test] avoid scanning Base twice for ambiguities (#43694)
1 parent e9ad4f6 commit b0fbc5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/Test/src/Test.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,7 @@ function detect_ambiguities(mods::Module...;
17201720
end
17211721
end
17221722
work = Base.loaded_modules_array()
1723+
filter!(mod -> mod === parentmodule(mod), work) # some items in loaded_modules_array are not top modules (really just Base)
17231724
while !isempty(work)
17241725
mod = pop!(work)
17251726
for n in names(mod, all = true)
@@ -1754,8 +1755,8 @@ function detect_unbound_args(mods...;
17541755
mods = collect(mods)::Vector{Module}
17551756
function examine(mt::Core.MethodTable)
17561757
for m in Base.MethodList(mt)
1757-
has_unbound_vars(m.sig) || continue
17581758
is_in_mods(m.module, recursive, mods) || continue
1759+
has_unbound_vars(m.sig) || continue
17591760
tuple_sig = Base.unwrap_unionall(m.sig)::DataType
17601761
if Base.isvatuple(tuple_sig)
17611762
params = tuple_sig.parameters[1:(end - 1)]
@@ -1769,6 +1770,7 @@ function detect_unbound_args(mods...;
17691770
end
17701771
end
17711772
work = Base.loaded_modules_array()
1773+
filter!(mod -> mod === parentmodule(mod), work) # some items in loaded_modules_array are not top modules (really just Base)
17721774
while !isempty(work)
17731775
mod = pop!(work)
17741776
for n in names(mod, all = true)

0 commit comments

Comments
 (0)