diff --git a/test/ambiguous.jl b/test/ambiguous.jl index 299cdfd7f3b67..4027759624ba6 100644 --- a/test/ambiguous.jl +++ b/test/ambiguous.jl @@ -133,7 +133,8 @@ ambs = detect_ambiguities(Ambig5) @test length(ambs) == 2 # Test that Core and Base are free of ambiguities -@test (x->(isempty(x) || println(x)))(detect_ambiguities(Core, Base; imported=true)) +@test detect_ambiguities(Core, Base; imported=true) == [] +# not using isempty so this prints more information when it fails amb_1(::Int8, ::Int) = 1 amb_1(::Integer, x) = 2 diff --git a/test/math.jl b/test/math.jl index 4b9678e805fb6..82b249bc059cd 100644 --- a/test/math.jl +++ b/test/math.jl @@ -773,6 +773,7 @@ module Test19626 +(a::MockQuantity, b::MockQuantity) = MockQuantity(a.val+b.val) -(a::MockQuantity, b::MockQuantity) = MockQuantity(a.val-b.val) *(a::MockQuantity, b::Number) = MockQuantity(a.val*b) + *(a::MockQuantity, b::Bool) = MockQuantity(a.val*b) # resolve ambiguity abs(a::MockQuantity) = MockQuantity(abs(a.val)) isnan(a::MockQuantity) = isnan(a.val) isinf(a::MockQuantity) = isinf(a.val)