Skip to content

Commit 7376d10

Browse files
committed
Wrap unbound_args.jl into module
1 parent 3b4dd23 commit 7376d10

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/unbound_args.jl

+10-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ h(x1::T, x2::T...) = do_something(T[x1, x2...])
3333
```
3434
"""
3535
function test_unbound_args(m::Module; broken::Bool = false)
36-
unbounds = detect_unbound_args_recursively(m)
36+
unbounds = UnboundArgs.detect_unbound_args_recursively(m)
3737
if !isempty(unbounds)
3838
printstyled(
3939
stderr,
@@ -51,19 +51,27 @@ function test_unbound_args(m::Module; broken::Bool = false)
5151
end
5252
end
5353

54+
module UnboundArgs
55+
56+
using Test
57+
5458
# There used to be a bug in `Test.detect_unbound_args` when used on
5559
# a top-level module together with `recursive = true`, see
5660
# <https://github.com/JuliaLang/julia/pull/31972>. This was fixed
5761
# some time between 1.4.2 and 1.5.4, but for older versions we
5862
# define `detect_unbound_args_recursively` with a workaround.
5963
@static if VERSION < v"1.5.4"
64+
using Aqua: walkmodules
65+
6066
function detect_unbound_args_recursively(m)
6167
methods = []
6268
walkmodules(m) do x
63-
append!(methods, detect_unbound_args(x))
69+
append!(methods, Test.detect_unbound_args(x))
6470
end
6571
return methods
6672
end
6773
else
6874
detect_unbound_args_recursively(m) = Test.detect_unbound_args(m; recursive = true)
6975
end
76+
77+
end # module

0 commit comments

Comments
 (0)