From: Robert Dober Date: 2008-03-30T05:09:21+09:00 Subject: Re: What's going on here? (weird Ruby 1.9 incompatibility) On Sat, Mar 29, 2008 at 7:08 PM, Tony Arcieri wrote: > class A > def a > 'yay' > end > end > > class B > def initialize(&meth) > class << self; self; end.__send__(:define_method, :b, &meth) > end > end > > b = B.new &A.new.method(:a) > p b.b > > Ruby 1.8 prints: > "yay" > > Ruby 1.9 complains (on the p b.b line): > 14:in `
': wrong number of arguments (1 for 0) (ArgumentError) > > -- > Tony Arcieri > medioh.com > I added the output of the arity of the methods, looks very much like a bug to me, are you familiar with the Bug Reporting process? ma = A.new.method(:a) p ma.arity # --> 0 b = B.new( &ma ) mb = b.method(:b) p mb.arity # --> 0 p b.b # bombs Cheers Robert -- http://ruby-smalltalk.blogspot.com/ --- Whereof one cannot speak, thereof one must be silent. Ludwig Wittgenstein