Skip to content

Commit

Permalink
Bound number of ambiguous methods in stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Aug 17, 2019
1 parent cd6f059 commit 5a7185a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/ambiguous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ ambs = detect_ambiguities(Ambig5)
# some ambiguities involving Union{} type parameters are expected, but not required
@test !isempty(detect_ambiguities(Core, Base; imported=true, ambiguous_bottom=true))

module AmbigStdlib
using Test

# List standard libraries. Exclude modules such as Main.
modules = [mod for (pkg, mod) in Base.loaded_modules if pkg.uuid !== nothing]

# not using isempty so this prints more information when it fails
@test detect_ambiguities(modules...; imported=true, recursive=true) == []
end # module

amb_1(::Int8, ::Int) = 1
amb_1(::Integer, x) = 2
amb_1(x, ::Int) = 3
Expand Down

0 comments on commit 5a7185a

Please sign in to comment.