`UndefRefError` for keyword methods with anonymous type variable in `where` bound
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 52/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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)
- Langage dominant
- Julia
- Étoiles
- 19
- Forks
- 16
- Merge moyen
- 2 j 21 h
- PR mergées (30 j)
- 2
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de JuliaDebug/LoweredCodeUtils.jl
-
tagbot-manual
Difficulté 1/5 Moins d'une heure Accessibilité débutants 25/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
JuliaDebug/LoweredCodeUtils.jl#80 · 4 commentaires ·
-
`typeof(ref)` shown on stdoutOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 38/100
JuliaDebug/LoweredCodeUtils.jl#69 · 3 commentaires ·
Toutes les issues de JuliaDebug/LoweredCodeUtils.jl
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
JuliaDebug/Cthulhu.jl#716 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Review dependenciesOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
rafaqz/DimensionalData.jl#1253 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
osrep/Runes2P.jl#283 ·
Les mainteneurs répondent en général sous 1 jour