Actions
Bug #17182
closedRefinements behavior is broken
Description
Calling the methods defined by Refinements via super
from a singleton method breaks the behavior.
class X
def hoge
["X#hoge"]
end
end
using Module.new {
refine X do
def hoge
["refine #hoge"] + super
end
end
}
x = X.new
def x.hoge
["x.hoge"] + super
end
# Refinements method is not called
p x.hoge
# 2.7.1 => ["x.hoge", "refine #hoge", "X#hoge"] OK: Expected behavior
# 3.0.0 => ["x.hoge", "X#hoge"] NG: Behavior is broken.
# Method#super_method refers to a Refinements method
p x.method(:hoge).super_method.call
# 2.7.1 => ["refine #hoge", "X#hoge"]
# 3.0.0 => ["refine #hoge", "X#hoge"]
This is broken by a fix for [Bug #17007]
.
commit: https://github.com/ruby/ruby/commit/eeef16e190cdabc2ba474622720f8e3df7bac43b
Is this the intended change?
Actions
Like0
Like0Like0Like0