diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2024-01-22 10:46:12 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2024-01-22 11:26:21 -0500 |
| commit | a7af34fa8b6f1f370f8fa6c66086fc5669a9d0a2 (patch) | |
| tree | 8c4bae02afb4d83be21e1a296d6d671a3f2df270 /test/ruby | |
| parent | 5906ce42fe04e8d4a4fe4b68b8ac54193598db56 (diff) | |
[PRISM] Fix keywords arguments in IndexAndWriteNode
Fixes ruby/prism#2233.
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 4cd7bff60a..0998c8fa5d 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -385,6 +385,15 @@ module Prism hash["key", &(Proc.new { _1.upcase })] &&= "value" hash CODE + + # Test with keyword arguments + assert_prism_eval(<<~RUBY) + h = Object.new + def h.[](**b) = 0 + def h.[]=(*a, **b); end + + h[foo: 1] &&= 2 + RUBY end def test_IndexOrWriteNode |
