Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Oct 14, 2020
1 parent 3f285af commit fed2f16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/value.jl
Expand Up @@ -2,6 +2,7 @@ CategoricalValue(level::Integer, pool::CategoricalPool{T, R}) where {T, R} =
CategoricalValue(convert(R, level), pool)

leveltype(::Type{<:CategoricalValue{T}}) where {T} = T
leveltype(::Type{Union{Missing, C}}) where {C <: CategoricalValue} = Union{Missing, leveltype(C)}
leveltype(::Type{T}) where {T} = T
leveltype(x::Any) = leveltype(typeof(x))
# to fix ambiguity
Expand Down
2 changes: 1 addition & 1 deletion test/13_arraycommon.jl
Expand Up @@ -2042,7 +2042,7 @@ end
end

rp = DataAPI.refpool(y)
@test rp isa AbstractVector{eltype(y)}
@test rp isa AbstractVector{CategoricalArrays.leveltype(eltype(y))}
@test Base.IndexStyle(rp) isa Base.IndexLinear
@test LinearIndices(rp) == axes(rp, 1)
if eltype(y) >: Missing
Expand Down

0 comments on commit fed2f16

Please sign in to comment.