`UndefRefError` for keyword methods with anonymous type variable in `where` bound
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- Julia
- Estrellas
- 19
- Forks
- 16
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de JuliaDebug/LoweredCodeUtils.jl
-
tagbot-manual
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
JuliaDebug/LoweredCodeUtils.jl#80 · 4 comentarios ·
-
`typeof(ref)` shown on stdoutAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 38/100
JuliaDebug/LoweredCodeUtils.jl#69 · 3 comentarios ·
Todos los issues de JuliaDebug/LoweredCodeUtils.jl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
JuliaDebug/Cthulhu.jl#716 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Review dependenciesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
rafaqz/DimensionalData.jl#1253 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
osrep/Runes2P.jl#283 ·
Los mantenedores suelen responder en 1 día