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

.! fails for BitVector #25660

Closed
stevengj opened this issue Jan 20, 2018 · 4 comments
Closed

.! fails for BitVector #25660

stevengj opened this issue Jan 20, 2018 · 4 comments
Labels
broadcast Applying a function over a collection bug Indicates an unexpected problem or unintended behavior packages Package management and loading regression Regression in behavior compared to a previous version

Comments

@stevengj
Copy link
Member

For some reason, broadcasting ! to a BitVector fails in 0.7, though it works in 0.6, and map succeeds:

julia> .!BitVector(rand(Bool, 10))
ERROR: MethodError: no method matching !(::UInt64)
Closest candidates are:
  !(::Missing) at missing.jl:69
  !(::Bool) at bool.jl:31
  !(::Function) at operators.jl:787
Stacktrace:
 [1] #8 at ./broadcast.jl:438 [inlined]
 [2] macro expansion at ./broadcast.jl:950 [inlined]
 [3] macro expansion at ./simdloop.jl:73 [inlined]
 [4] chunkedcopyto!(::BitArray{1}, ::Base.Broadcast.Broadcasted{Nothing,Bool,Tuple{Base.OneTo{Int64}},Base.TupleLL{Tuple{Tuple{Bool},Tuple{Int64}},Base.TupleLLEnd},typeof(!),Base.TupleLL{BitArray{1},Base.TupleLLEnd}}) at ./broadcast.jl:949
 [5] copyto!(::BitArray{1}, ::Base.Broadcast.Broadcasted{Nothing,Bool,Tuple{Base.OneTo{Int64}},Base.TupleLL{Tuple{Tuple{Bool},Tuple{Int64}},Base.TupleLLEnd},typeof(!),Base.TupleLL{BitArray{1},Base.TupleLLEnd}}) at ./broadcast.jl:901
 [6] copyto! at ./broadcast.jl:860 [inlined]
 [7] copy at ./broadcast.jl:825 [inlined]
 [8] execute(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Base.Broadcast.Unknown,Nothing,Nothing,typeof(!),Base.TupleLL{BitArray{1},Base.TupleLLEnd}}) at ./broadcast.jl:1268
 [9] top-level scope

julia> map(x -> !x, BitVector(rand(Bool, 10)))
10-element BitArray{1}:
 false
 false
 false
  true
 false
 false
 false
  true
  true
  true

I noticed this because it caused Pkg.update() to fail for me, since .! on a BitVector is used by pkg/cache.jl.

@stevengj stevengj added bug Indicates an unexpected problem or unintended behavior packages Package management and loading regression Regression in behavior compared to a previous version broadcast labels Jan 20, 2018
@stevengj
Copy link
Member Author

.!rand(Bool, 10) works, so this seems specific to the broadcast code for BitVector.

@KristofferC
Copy link
Sponsor Member

Thi requires some PR to be merged into master to occur? The Tim Holy broadcasting one I guess?

@stevengj
Copy link
Member Author

Sorry, I just realized that I'm not on master, I'm on the teh-jn/lazydotfuse branch. It looks like this is a bug with #25377, since ! is incorrectly listed as a ChunkableOp, which would only be true if #25435 had been merged.

cc @timholy

@mbauman
Copy link
Sponsor Member

mbauman commented Jan 20, 2018

Yup, this is my mistake. ! is not "chunkable" — I just fixed that locally and I'll push it now.

@mbauman mbauman added the broadcast Applying a function over a collection label Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broadcast Applying a function over a collection bug Indicates an unexpected problem or unintended behavior packages Package management and loading regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

3 participants