I’m using Aqua.jl on my package and have addressed all issues that Aqua complained about except that it finds many ambiguities when I call Aqua.test_all on my package, but none if I call Aqua.test_ambiguities on my package (the latter excludes Core and Base).
There are many messages like the one below. Can I ignore such ambiguities? If not, how can I address them?
55 ambiguities found
Ambiguity #1
ForwardDiff.Dual(args...) @ ForwardDiff ~/.julia/packages/ForwardDiff/PcZ48/src/dual.jl:73
(::Type{T})(x::Base.TwicePrecision) where T<:Number @ Base twiceprecision.jl:266
Possible fix, define
ForwardDiff.Dual(::Base.TwicePrecision)
I haven’t tried recently, but I generally avoid running Aqua’s ambiguity test. Instead I just use Test.detect_ambiguities(MyPackage) and see if the resulting list is empty.
I think Aqua passes a long list of modules, some of which are “not yours.” I think this has some history: Test.detect_ambiguities originally (many Julia releases ago) didn’t do a good job with cross-package ambiguities, and so Aqua’s fix (at the cost of false positives) was to supply a superset of modules. But then I think what happened is that Test.detect_ambiguities got fixed, and now the Aqua approach is actively counterproductive. But I am not sure of any of this, as I wasn’t involved in the work. (CC @vtjnash.)
Aqua just calls detect_ambiguities so it’s presumably down to what gets passed in and how the results are processed.