Skip to content

Block variable shadowing and local_variables not matching up right #2129

@headius

Description

@headius

Here's the cases from MRI:

  def test_shadowing_local_variables
    bug9486 = '[ruby-core:60501] [Bug #9486]'
    x = tap {|x| break local_variables}
    assert_equal([:x, :bug9486], x)
  end

  def test_shadowing_block_local_variables
    bug9486 = '[ruby-core:60501] [Bug #9486]'
    x = tap {|;x| break local_variables}
    assert_equal([:x, :bug9486], x)
  end

And our results:

123) Failure:
TestVariable#test_shadowing_block_local_variables [/Users/headius/projects/jruby/test/mri/ruby/test_variable.rb:95]:
<[:x, :bug9486]> expected but was
<[:bug9486, :x, :x]>.

[5903/5997] TestVariable#test_shadowing_local_variables = 0.00 s              
124) Failure:
TestVariable#test_shadowing_local_variables [/Users/headius/projects/jruby/test/mri/ruby/test_variable.rb:89]:
<[:x, :bug9486]> expected but was
<[:bug9486, :x, :x]>.

Combination of parser and IR I would guess, but I have not investigated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions