Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Not A Bug
-
Affects Version/s: JRuby 1.6
-
Fix Version/s: None
-
Component/s: Parser
-
Labels:None
-
Environment:OSX
-
Testcase included:yes
-
Number of attachments :
Description
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
.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
The --1.9 mode was not in effect during the test. Using 1.9 mode, the results are correct (they agree with MRI ruby 1.9.2).