Skip to content

Commit 5058dba

Browse files
authored
Add compat annotation for sorting NTuples. (#56961)
Thanks @stevengj for pointing this out #54494 (comment)
1 parent 7801351 commit 5058dba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

base/sort.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1739,10 +1739,13 @@ function sort!(v::AbstractVector{T};
17391739
end
17401740

17411741
"""
1742-
sort(v; alg::Base.Sort.Algorithm=Base.Sort.defalg(v), lt=isless, by=identity, rev::Bool=false, order::Base.Order.Ordering=Base.Order.Forward)
1742+
sort(v::Union{AbstractVector, NTuple}; alg::Base.Sort.Algorithm=Base.Sort.defalg(v), lt=isless, by=identity, rev::Bool=false, order::Base.Order.Ordering=Base.Order.Forward)
17431743
17441744
Variant of [`sort!`](@ref) that returns a sorted copy of `v` leaving `v` itself unmodified.
17451745
1746+
!!! compat "Julia 1.12"
1747+
Sorting `NTuple`s requires Julia 1.12 or later.
1748+
17461749
# Examples
17471750
```jldoctest
17481751
julia> v = [3, 1, 2];

0 commit comments

Comments
 (0)