Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.1
-
Fix Version/s: JRuby 1.6.3
-
Component/s: Compiler
-
Labels:None
-
Environment:Fedora 14 (64bit) and Mac OSX 10.6.7
-
Number of attachments :
Description
The following code segment shows that the assignment c = 30 will result in the argument b being stripped off to become nil.
$ jruby --1.9 -S jirb
irb(main):001:0> def work(a = 10, b)
irb(main):002:1> puts a.inspect
irb(main):003:1> puts b.inspect
irb(main):004:1> c = 30
irb(main):005:1> end
=> nil
irb(main):006:0> work(20, 25)
20
nil
=> 30
$ cat work.rb
class A
def self.work(a = 0, b)
puts a.inspect
puts b.inspect
c = 0
end
end
$ cat runme.rb
require 'work'
A.work(20, 25)
$ jruby --1.9 runme.rb
20
nil