Project

General

Profile

Actions

Bug #5542

closed

Ruby 1.9.3-p0 changed arity on default initialization method

Added by jballanc (Joshua Ballanco) about 13 years ago. Updated about 13 years ago.

Status:
Rejected
Target version:
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
Backport:
[ruby-core:40647]

Description

The following code worked under 1.9.2-p290 but breaks with an Argument Error (1 for 0) under 1.9.3-p0:

class Foo; end
Foo.new(nil)

Furthermore, the reported arity for Object's initialize method has changed:

ruby-1.9.2-p290 :001 > Object.instance_method(:initialize).arity
 => -1 

ruby-1.9.3-p0 :001 > Object.instance_method(:initialize).arity
 => 0 

Files

noname (500 Bytes) noname Anonymous, 11/04/2011 01:23 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #2451: BasicObject.initialize with variable number of argumentClosedmatz (Yukihiro Matsumoto)12/07/2009Actions
Actions #1

Updated by jballanc (Joshua Ballanco) about 13 years ago

This was introduced in r29638:

* object.c: Make BasicObject.new accept no parameter.
  Revert of r26135 [ruby-core:27080], as per [ruby-core:32952].

Was this change in BasicObject.new intentional? If so, is it intentional that this behavior should be different than 1.9.2? If not can we have this back-ported?

Updated by kosaki (Motohiro KOSAKI) about 13 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to marcandre (Marc-Andre Lafortune)
  • Target version set to 1.9.3

Updated by Anonymous about 13 years ago

On Thu, Nov 03, 2011 at 06:19:19AM +0900, Joshua Ballanco wrote:

Issue #5542 has been updated by Joshua Ballanco.

This was introduced in r29638:

* object.c: Make BasicObject.new accept no parameter.
  Revert of r26135 [ruby-core:27080], as per [ruby-core:32952].

Was this change in BasicObject.new intentional? If so, is it intentional that this behavior should be different than 1.9.2? If not can we have this back-ported?

Yes, this was definitely an intentional change. Please see the threads
mentioned in the commit message ([ruby-core:27080] and
[ruby-core:32952]).

I cannot speak for backporting this to 1.9.2.

--
Aaron Patterson
http://tenderlovemaking.com/

Updated by jballanc (Joshua Ballanco) about 13 years ago

On Thu, Nov 3, 2011 at 12:15 PM, Aaron Patterson
wrote:

On Thu, Nov 03, 2011 at 06:19:19AM +0900, Joshua Ballanco wrote:

Issue #5542 has been updated by Joshua Ballanco.

This was introduced in r29638:

* object.c: Make BasicObject.new accept no parameter.
  Revert of r26135 [ruby-core:27080], as per [ruby-core:32952].

Was this change in BasicObject.new intentional? If so, is it intentional
that this behavior should be different than 1.9.2? If not can we have this
back-ported?

Yes, this was definitely an intentional change. Please see the threads
mentioned in the commit message ([ruby-core:27080] and
[ruby-core:32952]).

I can access the former thread, but the later [ruby-core:32952] seems to
have gone missing?

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/32952

I cannot speak for backporting this to 1.9.2.

I suppose backporting is not a huge issue (I actually caught this due to
some less-than-optimally implemented code in our code base), however I
worry about having this kind of a semantic change between minor versions.

  • Josh

Updated by marcandre (Marc-Andre Lafortune) about 13 years ago

  • Status changed from Assigned to Rejected

Hi,

I can access the former thread, but the later [ruby-core:32952] seems to
have gone missing?

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/32952

Indeed, the archive contains only half of the discussion about the revert. It starts at [ruby-core:32932]. Matz's [ruby-core:32952] is quoted in some replies.

http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-core/32932?32833-33811+split-mode-vertical

I cannot speak for backporting this to 1.9.2.

Yugui decided against it in [ruby-core:33035] and warn instead, so I'm closing this issue.

Updated by jballanc (Joshua Ballanco) about 13 years ago

Thank you much for the information. This seems like a good compromise.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0