385
385
Slice (S:: Slice ) = S
386
386
Slice {T} (S:: Slice ) where {T<: AbstractUnitRange } = Slice {T} (T (S. indices))
387
387
388
- axes (S:: Slice ) = (IdentityUnitRange (S . indices ),)
388
+ axes (S:: Slice ) = (axes1 (S ),)
389
389
axes1 (S:: Slice ) = IdentityUnitRange (S. indices)
390
- axes (S:: Slice{<:OneTo} ) = (S. indices,)
391
- axes1 (S:: Slice{<:OneTo} ) = S. indices
390
+ axes1 (S:: Slice{<:AbstractOneTo{<:Integer}} ) = S. indices
392
391
393
392
first (S:: Slice ) = first (S. indices)
394
393
last (S:: Slice ) = last (S. indices)
@@ -414,10 +413,9 @@ IdentityUnitRange(S::IdentityUnitRange) = S
414
413
IdentityUnitRange {T} (S:: IdentityUnitRange ) where {T<: AbstractUnitRange } = IdentityUnitRange {T} (T (S. indices))
415
414
416
415
# IdentityUnitRanges are offset and thus have offset axes, so they are their own axes
417
- axes (S:: IdentityUnitRange ) = (S ,)
416
+ axes (S:: IdentityUnitRange ) = (axes1 (S) ,)
418
417
axes1 (S:: IdentityUnitRange ) = S
419
- axes (S:: IdentityUnitRange{<:OneTo} ) = (S. indices,)
420
- axes1 (S:: IdentityUnitRange{<:OneTo} ) = S. indices
418
+ axes1 (S:: IdentityUnitRange{<:AbstractOneTo{<:Integer}} ) = S. indices
421
419
422
420
first (S:: IdentityUnitRange ) = first (S. indices)
423
421
last (S:: IdentityUnitRange ) = last (S. indices)
@@ -465,11 +463,11 @@ end
465
463
show (io:: IO , r:: IdentityUnitRange ) = print (io, " Base.IdentityUnitRange(" , r. indices, " )" )
466
464
iterate (S:: IdentityUnitRange , s... ) = iterate (S. indices, s... )
467
465
468
- # For OneTo , the values and indices of the values are identical, so this may be defined in Base.
466
+ # For AbstractOneTo , the values and indices of the values are identical, so this may be defined in Base.
469
467
# In general such an indexing operation would produce offset ranges
470
468
# This should also ideally return an AbstractUnitRange{eltype(S)}, but currently
471
469
# we're restricted to eltype(::IdentityUnitRange) == Int by definition
472
- function getindex (S:: OneTo , I:: IdentityUnitRange{<:AbstractUnitRange{<:Integer}} )
470
+ function getindex (S:: AbstractOneTo{<:Integer} , I:: IdentityUnitRange{<:AbstractUnitRange{<:Integer}} )
473
471
@inline
474
472
@boundscheck checkbounds (S, I)
475
473
return I
0 commit comments