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
julia> Base.@constprop:nonef(@nospecialize(A); x::Int=1) =2x
f (generic function with 1 method)
julia> m =only(methods(f))
f(A; x) in Main at REPL[1]:1
julia> m.constprop
0x02
julia> m.nospecialize
1
julia> fkw = Core.kwfunc(f)
f##kw (generic function with 1 method)
julia> mkw =only(methods(fkw))
(::var"#f##kw")(::Any, ::typeof(f), A) in Main at REPL[1]:1
julia> mkw.constprop
0x00# should be 0x02
julia> mkw.nospecialize
4
Case 2: arg-wide @nospecialize does not propagate to kw method
julia> Base.@constprop:nonef(A; x::Int=1) = (@nospecialize; 2x)
f (generic function with 1 method)
julia> m =only(methods(f))
f(A; x) in Main at REPL[1]:1
julia> m.constprop
0x02
julia> m.nospecialize
-1
julia> fkw = Core.kwfunc(f)
f##kw (generic function with 1 method)
julia> mkw =only(methods(fkw))
(::var"#f##kw")(::Any, ::typeof(f), A) in Main at REPL[1]:1
julia> mkw.constprop
0x00# should be 0x02
julia> mkw.nospecialize
0# should be -1
The text was updated successfully, but these errors were encountered:
Case 1: missing constprop annotation on kw method
Case 2: arg-wide
@nospecialize
does not propagate to kw methodThe text was updated successfully, but these errors were encountered: