Request to package developers: Please eliminate ambiguities with Base

jishnub
Sun, 02 Aug 2020 08:43:47 +0000
Community

It’s often frustrating when you want your package to depend on an amazing package A, but doing do introduces ambiguities in Base functions that A has not eliminated. There are several packages that I’ve come across recently with this issue:

HTTP.jl

Unrolled.jl

FillArrays.jl

The way to avoid this is often simply to put in

@test isempty(Test.detect_ambiguities(Base, Core, YourPackage))`

in your package’s runtests.jl after you’re done resolving the existing ones.

Methods ambiguities should be something that packages try to avoid. It’s possible that two packages A and B extend Base methods in a way that is ambiguous when one imports them both in the same session, and such issues might be harder to anticipate as a developer. However there’s no reason why A and B shouldn’t eliminate standalone ambiguities.

5 posts - 3 participants