Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

similar(pa, 0) stopped working #61

Closed
rikhuijzer opened this issue Mar 1, 2021 · 2 comments · Fixed by #60
Closed

similar(pa, 0) stopped working #61

rikhuijzer opened this issue Mar 1, 2021 · 2 comments · Fixed by #60

Comments

@rikhuijzer
Copy link

rikhuijzer commented Mar 1, 2021

When working on a PR for Gadfly.jl (GiovineItalia/Gadfly.jl#1521), I noticed that the update for PooledArrays.jl is breaking. I'm not sure whether this behavior is expected, so decided to check in.

With PooledArrays v1.1:

julia> using PooledArrays

julia> pa = PooledArray([1]);

julia> similar(pa, 0)
0-element PooledVector{Int64, UInt32, Vector{UInt32}}

With PooledArrays v1.2:

julia> similar(pa, 0)
ERROR: ArgumentError: collection must be non-empty
Stacktrace:
 [1] _extrema_itr
   @ ./operators.jl:483 [inlined]
 [2] _extrema_dims
   @ ./multidimensional.jl:1698 [inlined]
 [3] #extrema#488
   @ ./multidimensional.jl:1685 [inlined]
 [4] extrema
   @ ./multidimensional.jl:1685 [inlined]
 [5] PooledVector{Int64, UInt32, Vector{UInt32}}(rs::PooledArrays.RefArray{Vector{UInt32}}, invpool::Dict{Int64, UInt32}, pool::Vector{Int64}, refcount::Base.Threads.Atomic{Int64})
   @ PooledArrays ~/.julia/packages/PooledArrays/mXlIN/src/PooledArrays.jl:46
 [6] PooledArray
   @ ~/.julia/packages/PooledArrays/mXlIN/src/PooledArrays.jl:78 [inlined]
 [7] similar(pa::PooledVector{Int64, UInt32, Vector{UInt32}}, S::Type, dims::Tuple{Int64})
   @ PooledArrays ~/.julia/packages/PooledArrays/mXlIN/src/PooledArrays.jl:293
 [8] similar(a::PooledVector{Int64, UInt32, Vector{UInt32}}, dims::Int64)
   @ Base ./abstractarray.jl:735
 [9] top-level scope
   @ REPL[5]:1
@bkamins
Copy link
Member

bkamins commented Mar 1, 2021

This is fixed by #60. I am just waiting for @nalimilan to approve.

@bkamins bkamins linked a pull request Mar 1, 2021 that will close this issue
@rikhuijzer
Copy link
Author

Hmm, I could just have checked the PRs. Okay, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants