#333 new
oleg dashevskii

[BUG] Method is allowed to receive both block argument and actual block

Reported by oleg dashevskii | February 17th, 2008 @ 08:43 PM | in 1.0 preview

def foo(a,&b); [a,yield(b)] end

l = lambda { 99 }

# MRI says here "both block arg and actual block given" and it's an error.
r = foo(100, &l) do 999 end
# rbx just silently executes the code, returning [100,999]
p r

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »