Using _ as block parameter in 1.9 fails #1697

dbussink opened this Issue May 2, 2012 · 0 comments

2 participants

Rubinius member

When you use _ as a block parameter in 1.9 mode, it isn't assigned a value properly. Please see the added specs in 058fde1 that show the issue.

@leocassarani leocassarani was assigned May 13, 2013
@leocassarani leocassarani added a commit that closed this issue May 25, 2013
@leocassarani leocassarani Assign the first block argument named "_" on 1.9
On 1.9, block arguments named "_" are treated as completely separate
and renamed to "_0", "_1" etc behind the scenes.

Previously, accessing the value of the "_" variable inside the body of
the block would treat it as a previously-undeclared local variable,
which would have nil value.

To make "_" resolve to the first argument named "_", we simply avoid
renaming the first argument to "_0".

Fixes #1697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment