diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-10-01 01:03:40 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-10-01 20:00:22 +0900 |
| commit | 86ae409467e3674c142f012ee3b2288b0305d87c (patch) | |
| tree | 83bf629b420f46b12e80399c0fdd57d1a1e19941 /test/ruby | |
| parent | 35e124832e29b65c84d4e0e4e434616859f9bdf5 (diff) | |
[Bug #20764] Refactor argument forwarding in lambda
Reject argument forwarding in lambda:
- without parentheses
- after optional argument(s)
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11751
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_syntax.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 08b4a7ee1c..16bb914e3f 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1980,6 +1980,10 @@ eom assert_syntax_error('iter {|...|}', /unexpected/) assert_syntax_error('->... {}', unexpected) assert_syntax_error('->(...) {}', unexpected) + assert_syntax_error('->a,... {}', unexpected) + assert_syntax_error('->(a,...) {}', unexpected) + assert_syntax_error('->a=1,... {}', unexpected) + assert_syntax_error('->(a=1,...) {}', unexpected) assert_syntax_error('def foo(x, y, z) bar(...); end', /unexpected/) assert_syntax_error('def foo(x, y, z) super(...); end', /unexpected/) assert_syntax_error('def foo(...) yield(...); end', /unexpected/) |
