Actions
Bug #18629
closedblock args array splatting assigns to higher scope _ var
Bug #18629:
block args array splatting assigns to higher scope _ var
Description
v = 1; [[2]].each{ |(v)| }; p v
_ = 1; [[2]].each{ |(_)| }; p _
prints
1
2
You can see here that v is still 1 but _ isn't shadowed properly and is being assigned 2.
Reproducible from 2.3.8 to 3.0.2 (macOS rbenv)
Actions