« Return to Thread: What's going on here? (weird Ruby 1.9 incompatibility)

Re: What's going on here? (weird Ruby 1.9 incompatibility)

by Tony Arcieri :: Rate this Message:

Reply to Author | View in Thread

On Sat, Mar 29, 2008 at 12:08 PM, Tony Arcieri <tony@...> wrote:

>  Ruby 1.8 prints:
> "yay"
>
> Ruby 1.9 complains (on the p b.b line):
> 14:in `<main>': wrong number of arguments (1 for 0) (ArgumentError)
>

I tried changing A to have the following definition:

class A
  def a(*args)
    args
  end
end

Now:

Ruby 1.8:
[]

or if you call b.b(1,2,3):
[1,2,3]

Ruby 1.9:
[nil]

or if you call b.b(1,2,3):
[1]

Is this a bug?

--
Tony Arcieri
medioh.com

 « Return to Thread: What's going on here? (weird Ruby 1.9 incompatibility)