Feature #7730 ยป 0001-parse.y-warn-assigned-but-unused-in-toplevel.patch
parse.y | ||
---|---|---|
local->prev = lvtbl;
|
||
local->args = vtable_alloc(0);
|
||
local->vars = vtable_alloc(inherit_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
|
||
local->used = !inherit_dvars && RTEST(ruby_verbose) ? vtable_alloc(0) : 0;
|
||
local->used = !(inherit_dvars && ifndef_ripper(e_option_supplied(parser))+0) &&
|
||
RTEST(ruby_verbose) ? vtable_alloc(0) : 0;
|
||
lvtbl = local;
|
||
}
|
||
test/ruby/test_rubyoptions.rb | ||
---|---|---|
assert_in_out_err(["-we", "def foo\n _a=1\nend"], "", [], [], feature6693)
|
||
bug7408 = '[ruby-core:49659]'
|
||
assert_in_out_err(["-we", "def foo\n a=1\n :a\nend"], "", [], ["-e:2: warning: assigned but unused variable - a"], bug7408)
|
||
feature7730 = '[ruby-core:51580]'
|
||
assert_in_out_err(["-w", "-"], "a=1", [], ["-:1: warning: assigned but unused variable - a"], feature7730)
|
||
end
|
||
def test_shadowing_variable
|