JuliaGraphics / ColorTypes.jl

Basic color definitions and traits
Other
77 stars 35 forks source link

Fix inference regression on `eltypes_supported` #236

Closed kimikage closed 3 years ago

kimikage commented 3 years ago

I am not fully aware of this inference issue, but v0.10.11 affects the testing of ImageCore.jl, so I am releasing this as a quick fix.

codecov[bot] commented 3 years ago

Codecov Report

Merging #236 (2301308) into master (5fc5351) will increase coverage by 0.79%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
+ Coverage   95.30%   96.09%   +0.79%     
==========================================
  Files           8        8              
  Lines         745      743       -2     
==========================================
+ Hits          710      714       +4     
+ Misses         35       29       -6     
Impacted Files Coverage Δ
src/traits.jl 98.88% <100.00%> (-0.01%) :arrow_down:
src/precompile.jl 100.00% <0.00%> (+1.06%) :arrow_up:
src/types.jl 94.53% <0.00%> (+1.28%) :arrow_up:
src/conversions.jl 86.81% <0.00%> (+1.86%) :arrow_up:

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 5fc5351...2301308. Read the comment docs.

kimikage commented 3 years ago

Since eltypes_supported is difficult for the compiler to infer, the @generated function seems to be more suitable (using loops instead of recursion).

kimikage commented 3 years ago

Incidentally, from this time on, it is being tested with Julia v1.5.4; the testing of some of the downstream packages with Julia v1.5.3 and v1.6.0-rc2 was done locally.