Regression: multiple refinements of the same class #5550
Given the code below:
class A def foo puts "foo" self end end using(Module.new do refine A do def baz puts "bar" self end end end) using(Module.new do refine A do def bar puts "bar" self end end end) begin A.new.foo.baz.bar rescue => e p e.message end begin A.new.foo.bar.baz rescue => e p e.message end
I expect it to print:
The code below worked in 22.214.171.124 (just checked: broken since 126.96.36.199).
It prints exceptions:
If I change the order of
Fixed once #5627 lands.
Note that MRI 2.5 does not match your expected output, but does match JRuby output after #5627:
If you have some other expectation we should dig into that...but otherwise we're going to call this fixed since it matches MRI.
Fixed for 9.2.7 (note this output differs from description due to a typo by @palkan):