I have a dummy object that always yield itself:
x = Object.new; x.define_singleton_method(:method_missing) { |*| x }
x.foo.bar.baz == x # => true
I wanted to simplify it, but suddenly it doesn't work anymore:
x = Object.new; def x.method_missing(*) x end
x.foo # raises SystemStackError, stack level too deep
Why is a SystemStackError
raised in that last example?