JuliaStats / NullableArrays.jl

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

WIP: allow value array to be any AbstractArray #170

Open shashi opened 7 years ago

shashi commented 7 years ago

This makes possible construction of NullableArray of StructOfArrays, or other funky arrays which solve orthogonal problems.

The following fails with this patch applied:

julia> isequal(NullableArray(Union{},1), NullableArray(Float64,1))
ERROR: indexing not defined for NullableArrays.NullableArray{Union{},1}
 in _getindex(::Base.LinearFast, ::NullableArrays.NullableArray{Union{},1}, ::Int64) at ./abstractarray.jl:763
 in next at ./iterator.jl:98 [inlined]
 in isequal(::NullableArrays.NullableArray{Union{},1}, ::NullableArrays.NullableArray{Float64,1}) at ./abstractarray.jl:1385

Stepping through this with Gallium doesn't fail with this error, it instead succeeds in returning true! cc @keno

shashi commented 7 years ago

Note that there are no problems if we are comparing nullablearrays of other types:

julia> isequal(NullableArray(Int64,1), NullableArray(Float64,1))
true

This strikes me as strange (it is possible I'm doing something really stupid). I suspect the problem is Union{} and inlining but I don't know how to dive deeper into this...

shashi commented 7 years ago

Super weird: test passes on 0.4 and 0.5 on travis but appveyor fails with the same error

image

nalimilan commented 7 years ago

Just bumped into this, might be related to the bug you're getting? https://github.com/JuliaLang/julia/issues/10326