diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-29 14:24:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-29 14:24:24 +0000 |
commit | 6fe9b2b79446e20e4a3a48c898313c63258182d5 (patch) | |
tree | a45bc1c90151fc2378d4db87856a48b4e23e386b /parse.y | |
parent | 98ea62756142b6c9cc030e99b6d936d986ce463c (diff) | |
download | ruby-6fe9b2b79446e20e4a3a48c898313c63258182d5.tar.gz |
parse.y: warn iside a block
* parse.y (gettable_gen): also warn circular argument reference even
inside a block. [ruby-core:65990] [Bug #10314]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -8733,7 +8733,12 @@ gettable_gen(struct parser_params *parser, ID id) } switch (id_type(id)) { case ID_LOCAL: - if (dyna_in_block() && dvar_defined(id)) return NEW_DVAR(id); + if (dyna_in_block() && dvar_defined(id)) { + if (id == current_arg) { + rb_warnV("circular argument reference - %"PRIsVALUE, rb_id2str(id)); + } + return NEW_DVAR(id); + } if (local_id(id)) { if (id == current_arg) { rb_warnV("circular argument reference - %"PRIsVALUE, rb_id2str(id)); |