diff --git a/test/test_parser.rb b/test/test_parser.rb index 2831c9eb6..d18337002 100644 --- a/test/test_parser.rb +++ b/test/test_parser.rb @@ -11148,4 +11148,36 @@ def test_kwoptarg_with_kwrestarg_and_forwarded_args %q{}, SINCE_3_2) end + + def test_argument_forwarding_with_anon_rest_kwrest_and_block + assert_diagnoses( + [:error, :unexpected_token, { token: 'tBDOT3' }], + %q{def f(*, **, &); g(...); end}, + %q{}, + SINCE_3_2) + + assert_diagnoses( + [:error, :no_anonymous_restarg], + %q{def f(...); g(*); end}, + %q{}, + SINCE_3_2) + + assert_diagnoses( + [:error, :no_anonymous_restarg], + %q{def f(...); g(0, *); end}, + %q{}, + SINCE_3_2) + + assert_diagnoses( + [:error, :no_anonymous_kwrestarg], + %q{def f(...); g(**); end}, + %q{}, + SINCE_3_2) + + assert_diagnoses( + [:error, :no_anonymous_kwrestarg], + %q{def f(...); g(x: 1, **); end}, + %q{}, + SINCE_3_2) + end end