Yield/block args unwrap too many levels #234

Closed
kronos opened this Issue Mar 31, 2010 · 3 comments

Comments

Projects
None yet
3 participants
@kronos
Member

kronos commented Mar 31, 2010

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

This comment has been minimized.

Show comment Hide comment
@yfeldblum

yfeldblum Mar 31, 2010

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

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

@kronos

This comment has been minimized.

Show comment Hide comment
@kronos

kronos Mar 31, 2010

Member

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

Member

kronos commented Mar 31, 2010

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

@evanphx

This comment has been minimized.

Show comment Hide comment
@evanphx

evanphx May 5, 2010

Member

Fix in post 1.0

Member

evanphx commented May 5, 2010

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