`SortedSet{K,Ord}()`, `SortedDict{K,V,Ord}()` and `SortedMultiDict{K,V,Ord}()` throw for non-forward `Ord`

オープン 初心者向け
#1,002 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
julia
領域
tooling

調査の方向性

スニペットで再現する: SortedSet{Int, typeof(Base.Order.Reverse)}() に加えて dict 形式と multidict 形式。src/sorted_set.jl:18、src/sorted_dict.jl:19、src/sorted_multi_dict.jl:17 の外部コンストラクタを読み、issue がすでに動くと述べている where {Ord} 形式と比較する。非 Forward の Ord を使った引数なしの 3 つの呼び出しすべてでコンテナが構築され、ソート済みコンテナのテストが通れば完了。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Julia
スター
747
フォーク
261
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaCollections/DataStructures.jl のほかの issue

JuliaCollections/DataStructures.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。