diff --git a/src/PooledArrays.jl b/src/PooledArrays.jl index 30f1753..e3f0ddf 100644 --- a/src/PooledArrays.jl +++ b/src/PooledArrays.jl @@ -67,7 +67,7 @@ PooledArray(d::PooledArray) = copy(d) function _label(xs::AbstractArray, ::Type{T}=eltype(xs), - ::Type{I}=UInt8, + ::Type{I}=DEFAULT_POOLED_REF_TYPE, start = 1, labels = Array{I}(undef, size(xs)), invpool::Dict{T,I} = Dict{T, I}(), diff --git a/test/runtests.jl b/test/runtests.jl index f455eec..af967b5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -69,8 +69,10 @@ using DataAPI: refarray, refvalue, refpool @test PooledArray{Union{Int,Missing}}([1, 2]) isa PooledArray{Union{Int,Missing}} - @test eltype(PooledArray(rand(128)).refs) == UInt8 - @test eltype(PooledArray(rand(300)).refs) == UInt16 + @test eltype(PooledArray(rand(128)).refs) == UInt32 + @test eltype(PooledArray(rand(300)).refs) == UInt32 + @test eltype(PooledArray(rand(128), UInt8).refs) == UInt8 + @test eltype(PooledArray(rand(300), UInt16).refs) == UInt16 @test PooledVector == PooledArray{T, R, 1} where {T, R} @test PooledMatrix == PooledArray{T, R, 2} where {T, R}