JuliaStats / NullableArrays.jl

DEPRECATED Prototype of the new JuliaStats NullableArrays package
Other
35 stars 21 forks source link

Fix broadcast() and map() with constructors #177

Closed nalimilan closed 7 years ago

nalimilan commented 7 years ago

Non-singleton types do not have an 'instance' field, so we cannot call null_safe_op() from a generated function for them. This means they will always be considered as unsafe.

Unfortunately, this means that the return type cannot be computed from the generated function either, and type inference only works on Julia 0.6.

Fixes https://github.com/JuliaStats/NullableArrays.jl/issues/176.

codecov-io commented 7 years ago

Codecov Report

Merging #177 into master will increase coverage by 0.15%.

@@            Coverage Diff             @@
##           master     #177      +/-   ##
==========================================
+ Coverage   60.24%   60.39%   +0.15%     
==========================================
  Files          13       13              
  Lines         664      664              
==========================================
+ Hits          400      401       +1     
+ Misses        264      263       -1
Impacted Files Coverage Δ
src/lift.jl 90% <100%> (ø) :white_check_mark:
src/broadcast.jl 83.78% <ø> (+2.7%) :white_check_mark:

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 bdc4614...e28e569. Read the comment docs.

nalimilan commented 7 years ago

I've found a bug in the existing code on Julia 0.5, and I figured an ugly way of computing the return type on Julia 0.5. The new code should work as expected everywhere (even if constructors cannot be marked as null_safe_op).