diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-13 13:34:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-13 13:34:26 +0000 |
commit | 29b114a1ea1b06a94b19a334a3031574118d2301 (patch) | |
tree | 80fa3381eeb311d3f15bec0b72352c903f85772b /test/ruby/test_parse.rb | |
parent | 2bbc30520f04879ea9fe0b54c889e362853f9742 (diff) | |
download | ruby-29b114a1ea1b06a94b19a334a3031574118d2301.tar.gz |
parse.y: set used flag in gettable
* parse.y (dvar_defined_ref, dvar_defined): rename macros. only
gettable uses the former. assignable should not set LVAR_USED
flag.
* parse.y (gettable_gen): set used flag on local/dynamic variables
instead of setting in lexer. [ruby-core:82368] [Bug #13809]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index cc38214fd6..819fc7df95 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -881,8 +881,11 @@ x = __ENCODING__ def test_unused_variable o = Object.new assert_warning(/assigned but unused variable/) {o.instance_eval("def foo; a=1; nil; end")} + assert_warning(/assigned but unused variable/) {o.instance_eval("def bar; a=1; a(); end")} a = "\u{3042}" assert_warning(/#{a}/) {o.instance_eval("def foo; #{a}=1; nil; end")} + o = Object.new + assert_warning(/assigned but unused variable/) {o.instance_eval("def foo; tap {a=1; a()}; end")} end def test_named_capture_conflict |