Actions
Bug #20285
closedStale inline method caches when refinement modules are reopened
Description
This is essentially the same issue as #11672, but for inline method caches rather than class caches.
In Ruby 3.3 we started using inline caches for refinements. However, we weren't clearing inline caches when defined on a reopened refinement module.
class C
end
module R
refine C do
def m
:foo
end
end
end
using R
def m
C.new.m
end
raise unless :foo == m()
module R
refine C do
alias m m
def m
:bar
end
end
end
v = m()
raise "expected :bar, got #{v.inspect}" unless :bar == v
This will raise in Ruby 3.3 as the inline cache finds a stale refinement, but passes in previous versions.
Actions
Like0
Like0Like0Like0Like0Like0Like0