diff --git a/base/sort.jl b/base/sort.jl index 4605ccd06d734..4fdd08931e800 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -533,6 +533,7 @@ Base.@propagate_inbounds function Base.setindex!(v::WithoutMissingVector, x, i) v end Base.size(v::WithoutMissingVector) = size(v.data) +Base.axes(v::WithoutMissingVector) = axes(v.data) """ send_to_end!(f::Function, v::AbstractVector; [lo, hi]) diff --git a/test/sorting.jl b/test/sorting.jl index 15eec92166ec7..ec1666dabb2fb 100644 --- a/test/sorting.jl +++ b/test/sorting.jl @@ -562,6 +562,13 @@ end end end +@testset "Offset with missing (#48862)" begin + v = [-1.0, missing, 1.0, 0.0, missing, -0.5, 0.5, 1.0, -0.5, missing, 0.5, -0.8, 1.5, NaN] + vo = OffsetArray(v, (firstindex(v):lastindex(v)).+100) + @test issorted(sort!(vo)) + @test issorted(v) +end + @testset "searchsortedfirst/last with generalized indexing" begin o = OffsetVector(1:3, -2) @test searchsortedfirst(o, 4) == lastindex(o) + 1