aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index f9de9513e7..8e65bf775b 100644
--- a/parse.y
+++ b/parse.y
@@ -9890,7 +9890,8 @@ gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
if (dyna_in_block(p) && dvar_defined_ref(p, id, &vidp)) {
if (NUMPARAM_ID_P(id) && numparam_nested_p(p)) return 0;
if (id == p->cur_arg) {
- rb_warn1("circular argument reference - %"PRIsWARN, rb_id2str(id));
+ compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
+ return 0;
}
if (vidp) *vidp |= LVAR_USED;
node = NEW_DVAR(id, loc);
@@ -9898,7 +9899,8 @@ gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
}
if (local_id_ref(p, id, &vidp)) {
if (id == p->cur_arg) {
- rb_warn1("circular argument reference - %"PRIsWARN, rb_id2str(id));
+ compile_error(p, "circular argument reference - %"PRIsWARN, rb_id2str(id));
+ return 0;
}
if (vidp) *vidp |= LVAR_USED;
node = NEW_LVAR(id, loc);