You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SortedSet{K,Ord}(), SortedDict{K,V,Ord}() and SortedMultiDict{K,V,Ord}() throw for non-forward Ord #1002
using DataStructures
R =typeof(Base.Order.Reverse)
SortedSet{Int, R}()
SortedDict{Int, Int, R}()
SortedMultiDict{Int, Int, R}()
Each call throws on master (b9ff234), Julia 1.13.4:
ERROR: MethodError: Cannot `convert` an object of type Base.Order.ForwardOrdering to an object of type DataStructures.BalancedTree23{Int64, Nothing, Base.Order.ReverseOrdering{Base.Order.ForwardOrdering}}
The constructors take o::Ord=Forward with Ord a parameter of the constructed type (src/sorted_set.jl:18, src/sorted_dict.jl:19, src/sorted_multi_dict.jl:17). The default Forward is a ForwardOrdering, so the zero-argument method matches only when Ord is ForwardOrdering. For other orderings, the call falls through to the inner constructor that takes a BalancedTree23.
Passing the ordering works: SortedSet{Int, R}(Base.Order.Reverse). Forms where Ord is a method parameter (SortedSet(o::Ord=Forward) where {Ord}) are fine.
Activity
oxinabox commentedon Nov 18, 2026
@StephenVavasis