From b15776f2e810855b49831a74b109ac4ccba957a5 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sun, 1 Dec 2024 08:40:27 -0600 Subject: [PATCH] Update base/sort.jl --- base/sort.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/sort.jl b/base/sort.jl index 31a940c173721..f9d74f626fe58 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -1767,7 +1767,7 @@ function sort(x::NTuple; order::Ordering=Forward, scratch::Union{Vector, Nothing}=nothing) # Can't do this check with type parameters because of https://github.com/JuliaLang/julia/issues/56698 - scratch === nothing || x isa NTuple{<:Any, eltype(scratch)} || throw(ArgumentError("scratch's eltype can't accommodate all the input elements")) + scratch === nothing || eltype(x) == eltype(scratch) || throw(ArgumentError("scratch has the wrong eltype")) _sort(x, alg, ord(lt,by,rev,order), (;scratch))::typeof(x) end # Folks who want to hack internals can define a new _sort(x::NTuple, ::TheirAlg, o::Ordering)