Actions
Bug #7261
closedSymbol#to_proc to retrieve a method from current refinement
Description
Currently Symbol#to_proc retrieves the global definition of the method, since refinement is a lexical scope.
But if possible, it is better that Symbol#to_proc can retrieve a method from current refinement.
module Silly
refine Integer do
def bar; p :bar; end
end
end
module Stupid
using Silly
1.bar # => :bar
[1,2].each(&:bar) # => undefined method `bar'
end
What do you think?
It should be done before 2.0.0 if we merge, to avoid future compatibility issues.
Matz.
Actions
Like0
Like0