tk3369 / BinaryTraits.jl

Can do or not? It's easy. See https://tk3369.github.io/BinaryTraits.jl/dev/
MIT License
51 stars 3 forks source link

Added return type check #48

Closed tk3369 closed 4 years ago

tk3369 commented 4 years ago

Implements #12.

The InterfaceReview struct has been enhanced to have an array of miss_reasons for missing implementations. It's used to indicate whether a method is physically missing or just having an unmatched return type.

As part of this PR, I have also split the tests into separate scripts.

tk3369 commented 4 years ago

Interesting, it didn't pass CI because Base.return_types in v1.0 works differently:

For this function:

f3(x::Number) = x + 1.0;

v1.4.1

julia> Base.return_types(f3, Tuple{Complex})
1-element Array{Any,1}:
 Complex

v1.0.5

julia> Base.return_types(f3, Tuple{Complex})
1-element Array{Any,1}:
 Complex{_1} where _1
codecov[bot] commented 4 years ago

Codecov Report

Merging #48 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #48   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          241       249    +8     
=========================================
+ Hits           241       249    +8     
Impacted Files Coverage Δ
src/interface.jl 100.00% <100.00%> (ø)
src/types.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7184a18...19de5b5. Read the comment docs.

tk3369 commented 4 years ago

Decided to not support return type check for v1.0. Added a @warn statement in the has_proper_return_type function.