`deleteat!` does not support `BitVector` in Julia 1.6.7 (LTS)

MWE:

julia> c = iseven.(rand(Int, 4))
4-element BitVector:
 1
 1
 0
 0

julia> deleteat!(c, [false, false, false, false])
ERROR: BoundsError: attempt to access 4-element BitVector at index [false]

This error does not occur on 1.7 or 1.8. I know for general users it’s advised to upgrade to the latest version of Julia ASAP, but since 1.6 is the current LTS, I wonder if it will get an update patch to fix this problem in the future? Thanks!

What you ask sounds like backporting to an older version a new feature introduced in a newer version, which is against semantic versioning: new features are never backported.

3 Likes

True, except I don’t think it’s considered a new feature since it’s included in the documentation of Julia 1.6?

The documentation doesn’t talk about bit vectors?

Anyway, I’m away from computer, can you point to the pull request which introduced support for bit vectors? I have no idea whether it was supposed to already work in v1.6 and it was fixed in v1.7, or the functionality was introduced in v1.7 (as your message seemed to imply)

1 Like

I realized that BitVector isn’t considered as the subtype of Vector which is suggested as the type constraint of a for the method deleteat!(a::Vector, inds), so it could be that BitVector is never indented to be supported even though it is in the later version (and the 1.8 documentation still says it only supports Vector). Sorry about the misinterpretation of the method. If the method is aimed to support AbstractVector later than 1.6, then only the documentation of 1.7 and 1.8 needs to be updated.

1 Like

I found the related issue here but it was brought up during the test period of 1.7. So should this be considered a bug fix or a new feature? In either case, the documentation should be updated to better clarify the support of BitVector.

Probably part of Improve corner cases of deleteat! by bkamins · Pull Request #42144 · JuliaLang/julia · GitHub related to deleteat!(trues(3), [true, false, false]) could be backported to 1.6 LTS as it is a bug fix. Just someone would need to work on it.

1 Like