Skip to content

Commit a4f2a6a

Browse files
authored
move maybetail to this package (#219)
* move maybetail to this package * version bump to v0.16.20 * add indexing test
1 parent bec0671 commit a4f2a6a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockArrays"
22
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3-
version = "0.16.19"
3+
version = "0.16.20"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/BlockArrays.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ import Base: @propagate_inbounds, Array, to_indices, to_index,
2424
getindex, ndims, show,
2525
step,
2626
broadcast, eltype, convert, similar,
27-
@_inline_meta, _maybetail, tail, @_propagate_inbounds_meta, reindex,
27+
@_inline_meta, tail, @_propagate_inbounds_meta, reindex,
2828
RangeIndex, Int, Integer, Number,
2929
+, -, *, /, \, min, max, isless, in, copy, copyto!, axes, @deprecate,
3030
BroadcastStyle, checkbounds, throw_boundserror,
3131
ones, zeros, intersect, Slice, resize!
3232
using Base: ReshapedArray, dataids
3333
import Base: AbstractArray
3434

35+
_maybetail(::Tuple{}) = ()
36+
_maybetail(t::Tuple) = tail(t)
3537

3638
import Base: (:), IteratorSize, iterate, axes1, strides, isempty
3739
import Base.Broadcast: broadcasted, DefaultArrayStyle, AbstractArrayStyle, Broadcasted, broadcastable

test/test_blockarrays.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ end
181181
a[1] = 2
182182
@test a == [2,2,3]
183183
@test a_data == [1,2,3]
184+
@test a[Block(1), 1] == a[Block(1)] == [2]
184185
a = BlockVector(a_data,(blockedrange([1,2]),))
185186
a[1] = 2
186187
@test a == [2,2,3]

0 commit comments

Comments
 (0)