Project

General

Profile

Bug #1393

Multiple assignment does not call to_a but to_ary

Added by scritch (Vincent Isambart) over 11 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Normal
Target version:
ruby -v:
1.9.1p0, 1.9.2dev (2009-04-19 trunk 23210)
Backport:

Description

=begin
In Ruby 1.9, when Ruby is expecting an array and does not get one (for example in splat arguments), it calls the to_a method on the object.
For example, if x is not an array, "y = *x" tries to call x.to_a.
However, in multiple assignments, it does not try to call to_a but to_ary.
For example, "*y = x" tries to call x.to_ary.
Should not Ruby try to call to_a in both cases? It looks like a bug to me.
Is there a particular reason this was done?
=end

Also available in: Atom PDF