Actions
Bug #14083
openRefinement in block calling incorrect method
Description
Tested on ruby versions 2.3.4 and 2.4.1
When a refinement is used inside a block, the scope of the refinement is not ending when the block has ended. The following example illustrates the issue:
Example:
class Example
def test
puts "Example#test"
end
end
module M1
refine Example do
def test
puts "Example#test in M1"
end
end
end
module M2
refine Example do
def test
puts "Example#test in M2"
end
end
end
e = Example.new
[M1, M2].each { |r|
e.test
using r
e.test
}
Actual Output
Example#test
Example#test in M1
Example#test in M1
Example#test in M2
Expected output
Example#test
Example#test in M1
Example#test
Example#test in M2
Updated by jeremyevans0 (Jeremy Evans) 7 months ago
- Related to Bug #11704: Refinements only get "used" once in loop added
Actions