JeffreySarnoff / SaferIntegers.jl

These integer types use checked arithmetic, otherwise they are as system types.
MIT License
59 stars 9 forks source link

Eliminate ambiguities #22

Closed mkitti closed 3 years ago

mkitti commented 3 years ago

Fix #21

mkitti commented 3 years ago

With this PR, I currently get:

julia> Test.detect_ambiguities(SaferIntegers)
Tuple{Method, Method}[]

Also all tests pass:

     Testing Running tests...
Test Summary: | Pass  Total
construct0    |   10     10
Test Summary: | Pass  Total
construct1    |  100    100
Test Summary: | Pass  Total
construct2    |    7      7
Test Summary: | Pass  Total
construct3    |   30     30
Test Summary: | Pass  Total
construct 4   |   10     10
Test Summary:  | Pass  Total
checked signed |   20     20
Test Summary:    | Pass  Total
checked unsigned |   20     20
Test Summary: | Pass  Total
throw         |   80     80
Test Summary: | Pass  Total
-unsigned     |    6      6
Test Summary: | Pass  Total
float         |    2      2
Test Summary: | Pass  Total
constructors  |    8      8
Test Summary: | Pass  Total
comparisons   |   24     24
Test Summary: | Pass  Total
boolean       |   14     14
Test Summary: | Pass  Total
arithmetic    |   52     52
Test Summary:             | Pass  Total
checked signed arithmetic |   24     24
Test Summary:               | Pass  Total
checked unsigned arithmetic |   22     22
Test Summary:            | Pass  Total
checked mixed arithmetic |   16     16
Test Summary:                       | Pass  Total
checked safe with unsafe arithmetic |   16     16
Test Summary: | Pass  Total
divide        |   11     11
Test Summary: | Pass  Total
number theory |   19     19
Test Summary: | Pass  Total
int ops       |   23     23
Test Summary: | Pass  Total
shifts        |   20     20
Test Summary: | Pass  Total
power         |   15     15
Test Summary: | Pass  Total
factorial     |    2      2
Test Summary: | Pass  Total
rational      |    3      3
Test Summary: | Pass  Total
string        |    2      2
Test Summary: | Pass  Total
ambiguities   |    1      1
     Testing SaferIntegers tests passed 
mkitti commented 3 years ago

What is left to do is examine the changes and see if they can be made more systematic. Also, perhaps we need to add some tests cases to check the previous ambiguities and also ensure functionality.

JeffreySarnoff commented 3 years ago

Thanks for the prompt attention, please stay on it -- I will merge asap

mkitti commented 3 years ago

Closing since the changes were incorporated elsewhere.