JuliaData/Missings.jl

When this migrates to 0.7, please fix ambiguities

Closed this issue · 3 comments

On Julia 0.7, this package currently has ambiguities due to the change in the iteration protocol:

julia> using Test, Missings

julia> detect_ambiguities(Base, Core)
4-element Array{Tuple{Method,Method},1}:
 (next(itr::Missings.EachFailMissing, state) in Missings at /home/tim/.julia/packages/Missings/Fu1R/src/Missings.jl:430, next(itr::I, state::Base.LegacyIterationCompat{I,T,S}) where {I, T, S} in Base at essentials.jl:851)   
 (done(itr::Missings.EachFailMissing, state) in Missings at /home/tim/.julia/packages/Missings/Fu1R/src/Missings.jl:427, done(itr::I, state::Base.LegacyIterationCompat{I,T,S}) where {I, T, S} in Base at essentials.jl:860)   
 (next(itr::Missings.EachReplaceMissing, state) in Missings at /home/tim/.julia/packages/Missings/Fu1R/src/Missings.jl:307, next(itr::I, state::Base.LegacyIterationCompat{I,T,S}) where {I, T, S} in Base at essentials.jl:851)
 (done(itr::Missings.EachReplaceMissing, state) in Missings at /home/tim/.julia/packages/Missings/Fu1R/src/Missings.jl:304, done(itr::I, state::Base.LegacyIterationCompat{I,T,S}) where {I, T, S} in Base at essentials.jl:860)

Some of us include detect_ambiguities as part of our package tests. In my quest to upgrade the Images.jl world to 0.7 this is now one of the last remaining sources of ambiguities. (It comes in only indirectly, presumably through StatsBase.) But, this is not urgent (I can work around it), I just wanted to make sure it's on the agenda eventually.

Looks like the ambiguity is due to the deprecation provided by Julia itself using next(itr::I, state::Base.LegacyIterationCompat{I,T,S}) where {I, T, S}? I'm not sure we can fix it on our end, since these iterators can wrap any iterable, and therefore just pass around its state, which can be of any type.

This is in the category "definitely not worth doing until you decide to get rid of start, next, and done altogether" (meaning, when you write your own iterate).

I beleve this is solved / can be closed 😺

using Missing v0.4.1:

julia> using Test, Missings

julia> detect_ambiguities(Base, Core)
0-element Array{Tuple{Method,Method},1}

julia> VERSION
v"1.0.4"
julia> using Test, Missings

julia> detect_ambiguities(Base, Core)
0-element Array{Tuple{Method,Method},1}

julia> VERSION
v"1.1.1"
julia> using Test, Missings

julia> detect_ambiguities(Base, Core)
0-element Array{Tuple{Method,Method},1}

julia> VERSION
v"1.2.0"
julia> using Test, Missings

julia> detect_ambiguities(Base, Core)
0-element Array{Tuple{Method,Method},1}

julia> VERSION
v"1.3.0-rc1.0"