![]() |
|
|
Issue Type:
|
Bug
|
Assignee:
|
Unassigned |
Components:
|
Core Classes/Modules |
Created:
|
26/May/12 2:37 AM
|
Description:
|
[[1,2]].pretty_inspect == "[1]\n"
I think this is related to a bug in splat handling with yield, but I'm not sure I can actually describe that bug (maybe it's https://jira.codehaus.org/browse/JRUBY-6550)
$ jruby --1.9 -S rake pry
[1] pry(main)> def a; yield *[[1,2]]; end
=> nil
[2] pry(main)> a{ |v| puts v.inspect }
1
$ jruby --1.8 -S rake pry
[1] pry(main)> def a; yield *[[1,2]]; end
=> nil
[2] pry(main)> a{ |v| puts v.inspect }
[1, 2]
It's pretty easy to work around, but I assume you guys would rather fix the underlying problem:
class Array
def pretty_print(q)
q.group(1, '[', ']') {
i = 0
q.seplist(self) { |*|
q.pp self[i]
i += 1
}
}
end
end
|
Project:
|
JRuby
|
Priority:
|
Major
|
Reporter:
|
Conrad Irwin
|
|
|
|
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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