Actions
Bug #7643
closedcall to super in define_method in refine results in stack level too deep
Description
=begin
When (({define_method})) is used within the refine block argument, calls to super will result in a stack level too deep. Definitions with def can call super without problems.
module A
refine Fixnum do
%i(+ -).each do |m|
define_method m do |other|
super(other)
end
end
def * other
super(other)
end
end
end
class B
using A
def working
puts 'working'
1 * 1
end
def error
puts 'stack level too deep'
1 + 1
end
end
puts B.new.working
puts B.new.error
=end
Files
Actions
Like0
Like0Like0Like0Like0