precedence changes within block
-------------------------------
Key: JRUBY-5616
URL: http://jira.codehaus.org/browse/JRUBY-5616
Project: JRuby
Issue Type: Bug
Components: Parser
Affects Versions: JRuby 1.6
Environment: OSX
Reporter: George Lippert
Assignee: Thomas E Enebo
Priority: Minor
Attachments: func_block_bug.rb
See listing below, showing behavior with ruby and with jruby. With ruby 1.9.2
both ways of printing the number of characters in "1024" produces "4", while
with jruby the expression is parsed differently and the resulting difference in
precedence produces two answers ("4" and "1024").
---------------
$ cat func_block_bug.rb
puts (2**10).to_s.length
Proc.new { puts (2**10).to_s.length }.call
$ rvm list
rvm rubies
jruby-1.6.0 [ darwin-x86_64-java ]
=> ruby-1.9.2-p180 [ x86_64 ]
$ ruby func_block_bug.rb
4
4
$ rvm use jruby
Using /Users/georgelippert/.rvm/gems/jruby-1.6.0
$ jruby func_block_bug.rb
func_block_bug.rb:2 warning: don't put space before argument parentheses
4
1024
--
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