Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for ambiguities? #439

Closed
wants to merge 3 commits into from
Closed

Conversation

mcabbott
Copy link
Contributor

@mcabbott mcabbott commented Apr 17, 2021

This runs detect_ambiguities, but doesn't (yet) demand the result be empty.

Here's the list it prints out: https://github.com/PainterQubits/Unitful.jl/pull/439/checks?check_run_id=2367869650#step:6:35

@giordano
Copy link
Collaborator

Interesting. I think it makes sense to have this test if it also enforces that there are no ambiguities, just printing them doesn't encourage too much to fix them 🙂

@mcabbott
Copy link
Contributor Author

I fixed a few, not sure I understand the package well enough to fix all of them, nor to know whether they can ever matter in practice.

So maybe this is more an issue than a PR for now. It could perhaps test length(detect_ambiguities(Unitful) <= 25 which would at least make it harder to introduce new ones.

@@ -191,6 +191,7 @@ for (_x,_y) in [(:fma, :_fma), (:muladd, :_muladd)]
# Catch some signatures pre-promotion
@eval @inline ($_x)(x::Number, y::AbstractQuantity, z::AbstractQuantity) = ($_y)(x,y,z)
@eval @inline ($_x)(x::AbstractQuantity, y::Number, z::AbstractQuantity) = ($_y)(x,y,z)
@eval @inline ($_x)(x::AbstractQuantity, y::AbstractQuantity, z::AbstractQuantity) = ($_y)(x,y,z)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this method means that the one below it can be deleted (it’s the same but with unused type parameters).

@sostock
Copy link
Collaborator

sostock commented Mar 23, 2023

Replaced by #606 and #626.

@sostock sostock closed this Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants