`UndefRefError` for keyword methods with anonymous type variable in `where` bound
まだ誰も着手していません。
評価
調査の方向性
Start by reading src/signatures.jl around the warning location at line 344, then trace how keyword method signatures with anonymous type variables in a where bound are handled. Reproduce the reported UndefRefError with a minimal keyword method and inspect the callee resolution. Done means the signature no longer triggers the warning or freezes Revise when rerun.
索引モデルが issue の本文から書いたものです。
説明
Hi, apologies if this issue should be in Revise.jl instead of here. I encountered this issue and worked around it in QuantumKitHub/MPSKit.jl#540.
Somehow, when a keyword argument method has an anonymous type variable inside the bound of a static parameter (in my specific case a where bound), the keyword-body function can't be resolved and raises a warning of the form
┌ Warning: skipping callee Main.:(var"#f#2") (called by Main.f) due to UndefRefError()
└ @ LoweredCodeUtils ~/.julia/packages/LoweredCodeUtils/WbxFQ/src/signatures.jl:344
When Revise attempts to rerun this signature, it freezes my REPL. I'm on Julia v1.12.6, Windows 11 if that matters.
Edit: I found a second trigger, namely anonymous type variables in the type of callable objects. MWE for the 2nd case:
struct Foo{T} end
(h::Foo{<:Integer})(x; kw...) = 1 # warns
(::Type{<:Foo})(x; kw...) = 1 # warns
(h::Foo{T})(x; kw...) where {T <: Integer} = 1 # fine
(h::Foo{<:Integer})(x) = 1 # fine (no keyword arguments)
(h::Foo)(x::Vector{<:Integer}; kw...) = 1 # fine (<: only in an argument type)
- 主要言語
- Julia
- スター
- 19
- フォーク
- 16
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaDebug/LoweredCodeUtils.jl のほかの issue
-
tagbot-manual
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
JuliaDebug/LoweredCodeUtils.jl#80 · コメント 4 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
JuliaDebug/LoweredCodeUtils.jl#69 · コメント 3 件 ·
JuliaDebug/LoweredCodeUtils.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
JuliaDebug/Cthulhu.jl#716 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Review dependenciesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rafaqz/DimensionalData.jl#1253 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
osrep/Runes2P.jl#283 ·
メンテナーはふだん 1 日以内に返信