mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 10:33:58 +02:00
* parse.y (shadowing_lvar_gen): get rid of adding extra name for
shadowing local variable. [ruby-dev:41628] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a8a264f1d
commit
47fb01e35b
4 changed files with 76 additions and 9 deletions
|
@ -415,4 +415,10 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
ensure
|
||||
t.close(true) if t
|
||||
end
|
||||
|
||||
def test_unused_variable
|
||||
feature3446 = '[ruby-dev:41620]'
|
||||
assert_in_out_err(["-we", "a=1"], "", [], ["-e:1: warning: assigned but unused variable - a"], feature3446)
|
||||
assert_in_out_err(["-we", "1.times do\n a=1\nend"], "", [], ["-e:2: warning: assigned but unused variable - a"], feature3446)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue