Super obscure 1.8.7 masgn splat in a paren bug
----------------------------------------------
Key: JRUBY-4125
URL: http://jira.codehaus.org/browse/JRUBY-4125
Project: JRuby
Issue Type: Bug
Components: Interpreter
Affects Versions: JRuby 1.4.0RC1
Reporter: Thomas E Enebo
Not quite reduced test case, but the problem is (*b) is ending up as [2] versus
[[2]] (where 2 may not be 2 depending on which test case you are looking at
below). Interestingly Ruby 1.9 behaves the same as us so it is debatable
whether we need to fix this at all:
{noformat}
class X
def to_ary
[1, 2, 3]
end
end
x = X.new
puts "a, (*b) = 1, [2]"
a, (*b) = 1, [2]
p a == 1
p b == [[2]]
p b
puts "a, (*b) = 1, [x]"
a, (*b) = 1, [x]
p a == 1
p b == [[x]]
puts "a, (*b) = 1, [*x]"
a, (*b) = 1, [*x]
p a == 1
p b == [[1, 2, 3]]
puts "a, (*b) = 1, [*2]"
a, (*b) = 1, [*2]
p a == 1
p b == [[2]]
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email