`UndefRefError` for keyword methods with anonymous type variable in `where` bound
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- Julia
- Stelle
- 19
- Fork
- 16
- Merge medio
- 2g 21h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaDebug/LoweredCodeUtils.jl
-
tagbot-manual
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
JuliaDebug/LoweredCodeUtils.jl#80 · 4 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
JuliaDebug/LoweredCodeUtils.jl#69 · 3 commenti ·
Tutte le issue di JuliaDebug/LoweredCodeUtils.jl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
JuliaDebug/Cthulhu.jl#716 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Review dependenciesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
rafaqz/DimensionalData.jl#1253 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
osrep/Runes2P.jl#283 ·
I maintainer di solito rispondono entro 1 giorno