Prohibit numbered parameters as method arguments; fix
As of CRuby2.7 it is only warned. `mruby` prohibits explicitly to
implement the future Ruby3 behavior.
@@ -3538,6 +3538,11 @@ f_bad_arg : tCONSTANT
yyerror(p, "formal argument cannot be a class variable");
$$ = 0;
}
+ | tNUMPARAM
+ {
+ yyerror(p, "formal argument cannot be a numbered parameter");
+ $$ = 0;
+ }
;
f_norm_arg : f_bad_arg
@@ -5969,9 +5974,6 @@ parser_yylex(parser_state *p)
nvars->cdr = nint(-1);
nvars = nvars->car;
}
- if (intn(p->nvars->cdr) < 0) {
- yywarning(p, "numbered parameter in nested block");
- }
pylval.num = n;
p->lstate = EXPR_END;
return tNUMPARAM;
