Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Yield/block args unwrap too many levels #234

Closed
kronos opened this Issue · 3 comments

3 participants

@kronos
Collaborator

Rubinius collapses the inner array down to nil because it's empty. MRI appears to not unwrap the array in these contexts (but it does in other contexts).

def method
  yield *[[]]
end
method do |a,b,*c| 
  p a, b, c #=> [], nil, []
end

and

f = lambda {|r,| p r } # => r should be []
f.call([])
@yfeldblum

MRI 1.9.1 gives nil, nil, []. What is the expected result?

@kronos
Collaborator

For now rubinius should works identical to 1.8.7. 1.8.7 outputs [], nil, []

@evanphx
Owner

Fix in post 1.0

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.