From 082cfcfd06f85ea5c578f0654431dad5c2f32814 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Fri, 18 Nov 2022 19:42:37 +0900 Subject: Add test cases for args forwarding after rest argument --- test/ruby/test_syntax.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 7a5f4c9528..251448ec01 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1709,6 +1709,8 @@ eom assert_syntax_error('def foo(...) foo[...] = x; end', /unexpected/) assert_syntax_error('def foo(...) foo(...) { }; end', /both block arg and actual block given/) assert_syntax_error('def foo(...) defined?(...); end', /unexpected/) + assert_syntax_error('def foo(*rest, ...) end', '... after rest argument') + assert_syntax_error('def foo(*, ...) end', '... after rest argument') obj1 = Object.new def obj1.bar(*args, **kws, &block) -- cgit v1.2.3