Project

General

Profile

Bug #7643 ยป bug.rb

beatrichartz (Beat Richartz), 01/01/2013 02:49 AM

 
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
    (1-1/1)