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

**URL:** <https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107>\
**Category:** General Usage\
**Tags:** array, function\
**Created:** [August 21, 2022, 9:43pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107 "2022-08-21T21:43:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankwswang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frankwswang/32/18561_2.png) [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Post date:** [August 21, 2022, 9:43pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107/1 "2022-08-21T21:43:00Z")

</div>

MWE:

```julia
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!

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 21, 2022, 9:56pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107/2 "2022-08-21T21:56:19Z")

</div>

> [@frankwswang](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![frankwswang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frankwswang/32/18561_2.png) [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Post date:** [August 21, 2022, 9:59pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107/3 "2022-08-21T21:59:25Z")

</div>

True, except I don’t think it’s considered a new feature since it’s included in the [documentation of Julia 1.6](https://docs.julialang.org/en/v1.6/base/collections/#Base.deleteat!)?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 21, 2022, 10:05pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107/4 "2022-08-21T22:05:32Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![frankwswang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frankwswang/32/18561_2.png) [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Post date:** [August 21, 2022, 10:13pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107/5 "2022-08-21T22:13:35Z")

</div>

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](https://docs.julialang.org/en/v1.8/base/collections/#Base.deleteat!) 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.

---

<div class="post-metadata">

**Author:** ![frankwswang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frankwswang/32/18561_2.png) [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Post date:** [August 21, 2022, 10:23pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107/6 "2022-08-21T22:23:14Z")

</div>

I found the related issue [here](https://github.com/JuliaLang/julia/issues/42065#issuecomment-910729447) 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`.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [August 21, 2022, 10:46pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107/7 "2022-08-21T22:46:52Z")

</div>

Probably part of [Improve corner cases of deleteat! by bkamins · Pull Request #42144 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/42144) 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.
