summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index b256633189..da91b53a02 100644
--- a/parse.y
+++ b/parse.y
@@ -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));