Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Inadequate support of `promote_rule` for non-concrete types

オープン
#343 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
julia
領域
backend

調査の方向性

Reproduce the listed promote_rule cases in the Julia REPL and read the handling in ColorTypes.jl. Compare the behavior with issue #342, then establish expected results for the examples, including avoiding StackOverflowError. Done means the non-concrete promotion cases behave consistently without the reported errors.

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

説明

bug

For better or worse, PR #207 is the most significant change in FPN v0.9.
However the current promote_rule for non-concrete types is somewhat imperfect.
In ColorTypes.jl, I am keenly aware that the handling of non-concrete types can lead to chaos.
Here, I’d like to think about ways to make things a little better, as long as they don’t go against common sense.

julia> promote_rule(Normed{UInt8, 8}, Fixed{Int8, 7})
Float32

julia> promote_rule(Normed{UInt8}, Fixed{Int8})
Union{} # -> Float32

julia> promote_rule(Normed{UInt8}, Normed{UInt8})
Union{} # -> Normed{UInt8}

julia> promote_rule(Normed{UInt8}, Normed{UInt16})
Union{} # -> Normed{UInt16}

julia> promote_rule(Normed{UInt8}, Normed)
Union{} # -> Normed

julia> promote_rule(Normed{UInt8}, Normed{Union{UInt8, UInt16}})
Union{} # -> Normed (Any desire to make this more strict is a path to despair.)

julia> promote_rule(Normed{UInt8}, FixedPoint)
Union{} # -> FixedPoint

julia> promote_rule(Normed{UInt8}, Float64)
Float64

julia> promote_rule(Normed, Float64)
ERROR: StackOverflowError # -> BigFloat

julia> promote_rule(Normed{UInt8}, Int8)
Float32

julia> promote_rule(Normed, Int8)
Normed # -> BigFloat

Some of the unnatural promotions or stack overflow errors are caused by issue #342. In other words, fixing issue #342 will resolve some of these issues.

主要言語
Julia
スター
95
フォーク
38
平均マージ
16時間 31分
マージ済み PR(30日)
9

環境構築

はじめの一歩

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

JuliaMath/FixedPointNumbers.jl のほかの issue

JuliaMath/FixedPointNumbers.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

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

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