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
This was noticed in oxinabox/Tricks.jl#44 that the generated function does not correctly recompile if Base.delete_method and function call happened in a block, but it seems to be a regression on v1.12 without generated function. Here is a MWE:
on v1.10-v1.11:
julia> foo(x) ="1"
foo (generic function with 1 method)
julia> foo(::Int) ="2"
foo (generic function with 2 methods)
julia> foo(1)
"2"
julia> begin
Base.delete_method(first(methods(foo)))
@show foo(1)
end
foo(1) = "1"
"1"
but on v1.12 (1.12.0-DEV.1869 (2025-01-10) Commit d3964b600a5):
julia> foo(x) ="1"
foo (generic function with 1 method)
julia> foo(::Int) ="2"
foo (generic function with 2 methods)
julia> foo(1)
"2"
julia> begin
Base.delete_method(first(methods(foo)))
@show length(methods(foo))
@show foo(1)
@show foo(1)
end
length(methods(foo)) = 1
foo(1) = "2"
foo(1) = "2"
"2"
julia> foo(1)
"1"
However, the new behavior seems to match the behavior on all versions if you put the block inside a function. I'm not sure if it's an intended result.
The text was updated successfully, but these errors were encountered:
This was noticed in oxinabox/Tricks.jl#44 that the generated function does not correctly recompile if
Base.delete_method
and function call happened in a block, but it seems to be a regression on v1.12 without generated function. Here is a MWE:on v1.10-v1.11:
but on v1.12 (
1.12.0-DEV.1869 (2025-01-10) Commit d3964b600a5
):However, the new behavior seems to match the behavior on all versions if you put the block inside a function. I'm not sure if it's an intended result.
The text was updated successfully, but these errors were encountered: