File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change 124
124
offset_coerce (:: Type{I} , r:: AbstractUnitRange ) where I<: AbstractUnitRange{T} where T =
125
125
convert (I, r), 0
126
126
127
+ @inline Base. parent (r:: IdOffsetRange ) = r. parent
127
128
@inline Base. axes (r:: IdOffsetRange ) = (Base. axes1 (r),)
128
129
@inline Base. axes1 (r:: IdOffsetRange ) = IdOffsetRange (Base. axes1 (r. parent), r. offset)
129
130
@inline Base. unsafe_indices (r:: IdOffsetRange ) = (r,)
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ using CatIndices: BidirectionalVector
34
34
@test @inferred (OffsetArrays. IdOffsetRange {Int} (ro)) === ro
35
35
@test @inferred (OffsetArrays. IdOffsetRange {Int16} (ro)) === OffsetArrays. IdOffsetRange (Base. OneTo (Int16 (3 )))
36
36
@test @inferred (OffsetArrays. IdOffsetRange (ro)) === ro
37
+ @test parent (ro) === ro. parent
38
+ @test parent (rs) === rs. parent
37
39
# construction/coercion preserves the values, altering the axes if needed
38
40
r2 = @inferred (typeof (rs)(ro))
39
41
@test typeof (r2) === typeof (rs)
You can’t perform that action at this time.
0 commit comments