Bug #682

Rogue values bound to block parameters

Added by David Black over 6 years ago. Updated about 4 years ago.

[ruby-core:19503]
Status:Closed
Priority:Normal
Assignee:-
ruby -v: Backport:

Description

=begin
Code:

def block_args_unleashed
yield(1,2,3,4,5)
end

block_args_unleashed {|a,b=1,*c,d,e|
puts "Arguments:"
p a,b,c,d,e
}

Output:

1
1
[3, 4]
5
"/usr/local/lib/ruby-1.9" # <-- ???

b binds incorrectly, but this report is about e, which is bound to an irrelevant string.

Version:

ruby 1.9.0 (2008-10-25 revision 18859) [i386-darwin9.5.0]
=end

History

#1 Updated by Yuki Sonoda over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r19968.
=end

Also available in: Atom PDF