You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UndefRefError for keyword methods with anonymous type variable in where bound #173
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)
Activity