diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-26 02:54:01 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-26 02:54:01 +0000 |
commit | 7f69d4e41f1cd77e142b786596dd005891a233f3 (patch) | |
tree | 69da424273fcdac1321588b0d0cba395175f9e84 /test/ruby/test_parse.rb | |
parent | df38879ae627ce4990ab3c0b0645f824df0511ce (diff) |
parse.y: remove "shadowing outer local variable" warning
You can now write the following without warning.
user = User.all.find {|user| cond(user) }
Fixes [Feature #12490].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 6160aa1452..c7aeeecb61 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -911,10 +911,8 @@ x = __ENCODING__ assert_equal(expected, actual, bug5614) end - def test_shadowing_variable - assert_warning(/shadowing outer local variable/) {eval("a=1; tap {|a|}")} - a = "\u{3042}" - assert_warning(/#{a}/o) {eval("#{a}=1; tap {|#{a}|}")} + def test_no_shadowing_variable_warning + assert_no_warning(/shadowing outer local variable/) {eval("a=1; tap {|a|}")} end def test_unused_variable |