Inadequate support of `promote_rule` for non-concrete types
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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 の本文から書いたものです。
説明
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaMath/FixedPointNumbers.jl のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
JuliaMath/FixedPointNumbers.jl#342 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
JuliaMath/FixedPointNumbers.jl#337 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
JuliaMath/FixedPointNumbers.jl#331 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
needs comments
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
JuliaMath/FixedPointNumbers.jl#318 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
add-on enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
JuliaMath/FixedPointNumbers.jl#311 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
JuliaMath/FixedPointNumbers.jl の issue をすべて見る
似ている issue
-
add-on doc enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JuliaGraphics/ColorTypes.jl#344 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
`enzymexla.linalg.lu` lowering fails for a tall matrix: the permutation is built with the pivot typeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
EnzymeAD/Enzyme-JAX#3286 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
SciML/LinearSolve.jl#1359 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信