summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parse.y1
-rw-r--r--test/ruby/test_syntax.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index a97c01d69a..553f085937 100644
--- a/parse.y
+++ b/parse.y
@@ -4735,6 +4735,7 @@ f_norm_arg : f_bad_arg
| tIDENTIFIER
{
formal_argument(p, get_id($1));
+ p->max_numparam = -1;
$$ = $1;
}
;
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 488962b003..257fe07b3c 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1302,6 +1302,7 @@ eom
assert_syntax_error('->(x){@1}', /ordinary parameter is defined/)
assert_syntax_error('->x{@1}', /ordinary parameter is defined/)
assert_syntax_error('->x:@2{}', /ordinary parameter is defined/)
+ assert_syntax_error('->x=@1{}', /ordinary parameter is defined/)
assert_syntax_error('proc {@1 = nil}', /Can't assign to numbered parameter @1/)
assert_syntax_error('proc {@01}', /leading zero/)
assert_syntax_error('proc {@1_}', /unexpected/)