From: James French Date: 2012-02-21T02:25:35+09:00 Subject: Difference between 1.9.2 and 1.9.3 --_000_950618E0D00138499BE7CC487EBF646D6709A7B2F9WOODCHUCKNMlo_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable module A <- line 1 def initialize(*args, &block) super end end class B include A def initialize(name) super end end B.new('foo') ...executed without warnings under ruby 1.9.2 but under 1.9.3-p125 it gives= me: test.rb:3:in `initialize': wrong number of arguments(1 for 0) (ArgumentErro= r) from test.rb:3:in `initialize' from test.rb:10:in `initialize' from test.rb:14:in `new' from test.rb:14:in `
' Not calling 'super' in initialize in module A fixes it but then it seems th= at module A is not as generic and standalone in terms of how its included b= y classes. I guess its more correct because there is no super class in this= case. What should I change the code to for the best? Cheers, James --_000_950618E0D00138499BE7CC487EBF646D6709A7B2F9WOODCHUCKNMlo_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

module A &n= bsp;       <- line 1

  def initialize(*args, &block)

    super

=   end

end

 

class B

<= p class=3DMsoNormal>  include A

&nb= sp; def initialize(name)

  &nb= sp; super

  end

end

 

B.new('foo')

=  

...executed without warnings under rub= y 1.9.2 but under 1.9.3-p125 it gives me:

 

test.rb:3:in `initialize': wron= g number of arguments(1 for 0) (ArgumentError)

        from test.rb:3:in `initia= lize'

     &nbs= p;  from test.rb:10:in `initialize'

        from test.rb:14:in `new'

        fro= m test.rb:14:in `<main>'

&nbs= p;

 

= Not calling ‘super’ in initialize in module A fixes it but then= it seems that module A is not as generic and standalone in terms of how it= s included by classes. I guess its more correct because there is no super c= lass in this case. What should I change the code to for the best?

 

Cheers,=

James

= --_000_950618E0D00138499BE7CC487EBF646D6709A7B2F9WOODCHUCKNMlo_--