From: Peter Vandenabeele Date: 2012-02-21T19:00:51+09:00 Subject: Re: Difference between 1.9.2 and 1.9.3 --00235453009050249804b9767c00 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Feb 21, 2012 at 9:40 AM, Bartosz Dziewo=C5=84ski wrote: > That's because super with parentheses passes the same args your method > I assume this was a typo, meaning "without" parentheses. > was called with (like Dave said), and default Object#initialize method > takes no arguments. > > But that's interesting. You might want to mention it at Ruby's bug > tracker: bugs.ruby-lang.org - maybe the default initializer should > take any number of args and just discard them. > I think that is not a good idea. With the current implementation, it is still possible to add optional arguments later. If a method (e.g. initialize) would accept any number of arguments and just discard them, then later on, adding 1 or more optional arguments in the definition would suddenly cause bugs as these initially discarded arguments would then interpreted as a real, optional argument. Just write `super()` when calling the higher up initializer. HTH, Peter --00235453009050249804b9767c00 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Feb 21, 2012 at 9:40 AM, Bartosz Dziewo= =C5=84ski <matm= a.rex@gmail.com> wrote:
That's because super with parentheses passes the same args your method<= br>

I assume this was a typo, meaning "without&qu= ot; parentheses.
=C2=A0
was called with (like Dave said), and default Object#initialize method
takes no arguments.

But that's interesting. You might want to mention it at Ruby's bug<= br> tracker: bugs.ruby-= lang.org - maybe the default initializer should
take any number of args and just discard them.

I t= hink that is not a good idea. With the current implementation, it
is sti= ll possible to add optional arguments later. If a method (e.g.
initializ= e) would accept any number of arguments and just discard
them, then later on, adding 1 or more optional arguments in the
definiti= on would suddenly cause bugs as these initially discarded
arguments woul= d then interpreted as a real, optional argument.

Just write `super()= ` when calling the higher up initializer.

HTH,

Peter
--00235453009050249804b9767c00--