Skip to content

Commit 082cfcf

Browse files
committed
Add test cases for args forwarding after rest argument
1 parent 5c505f4 commit 082cfcf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/ruby/test_syntax.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,8 @@ def test_argument_forwarding
17091709
assert_syntax_error('def foo(...) foo[...] = x; end', /unexpected/)
17101710
assert_syntax_error('def foo(...) foo(...) { }; end', /both block arg and actual block given/)
17111711
assert_syntax_error('def foo(...) defined?(...); end', /unexpected/)
1712+
assert_syntax_error('def foo(*rest, ...) end', '... after rest argument')
1713+
assert_syntax_error('def foo(*, ...) end', '... after rest argument')
17121714

17131715
obj1 = Object.new
17141716
def obj1.bar(*args, **kws, &block)

0 commit comments

Comments
 (0)