Heiko Seebach created JRUBY-6568: ------------------------------------ Summary: A Proc on a symbol like (&:first) works in 1.8, but not in 1.9 mode Key: JRUBY-6568 URL: https://jira.codehaus.org/browse/JRUBY-6568 Project: JRuby Issue Type: Bug Components: Ruby 1.9.2 Affects Versions: JRuby 1.6.7 Environment: Ubuntu 10.11 - x64 Reporter: Heiko Seebach Assignee: Thomas E Enebo
The following code fragment should show it clearly. {code} me@mypc:~/$ cat test.rb class Array def proc_on_first yield([0]) end end ary = [[42]] p ary.proc_on_first{|b|b.first} p ary.proc_on_first(&:first) me@mypc:~/$ jruby --1.9 test.rb 0 NoMethodError: undefined method `first' for 0:Fixnum proc_on_first at test.rb:3 (root) at test.rb:10 me@mypc:~/$ jruby --1.8 test.rb 0 0 me@mypc:~/$ {code} There are severeal issues concerning Procs, Symbols and &, but I couldn't find one that shows this behaviour. In MRI Ruby 1.9.2 and 1.9.3 this works fine like in JRuby --1.8 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.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