`UndefRefError` for keyword methods with anonymous type variable in `where` bound
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 52/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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)
- Linguagem predominante
- Julia
- Estrelas
- 19
- Forks
- 16
- Merge médio
- 2d 21h
- PRs com merge (30d)
- 2
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de JuliaDebug/LoweredCodeUtils.jl
-
tagbot-manual
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 25/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
JuliaDebug/LoweredCodeUtils.jl#80 · 4 comentários ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 38/100
JuliaDebug/LoweredCodeUtils.jl#69 · 3 comentários ·
Todas as issues de JuliaDebug/LoweredCodeUtils.jl
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
JuliaDebug/Cthulhu.jl#716 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
Review dependenciesAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
rafaqz/DimensionalData.jl#1253 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
osrep/Runes2P.jl#283 ·
Mantenedores costumam responder em até 1 dia