diff options
author | Aaron Patterson <[email protected]> | 2024-01-19 12:00:35 -0800 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2024-01-19 12:32:20 -0800 |
commit | 4778b0eedaf4b490fe6b1fe2df9b58c1fe8e7639 (patch) | |
tree | b2999b269705a52edbb20f6bd2f75fed0cbf7671 /test | |
parent | e0f7cee8c54691127277d32b4560e44b8394cdc7 (diff) |
Fix kwarg ordering
Required keyword arguments need to come first.
Fixes: https://github.com/ruby/prism/issues/2158
Co-authored-by: Kevin Newton <[email protected]>
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_compile_prism.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index e1bd5cfb69..b675e23351 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -1464,6 +1464,10 @@ a CODE end + def test_required_kwarg_ordering + assert_prism_eval("def self.foo(a: 1, b:); [a, b]; end; foo(b: 2)") + end + def test_trailing_keyword_method_params # foo(1, b: 2, c: 3) # argc -> 3 assert_prism_eval("def self.foo(a, b:, c:); [a, b, c]; end; foo(1, b: 2, c: 3)") |