summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2024-01-23 13:13:56 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2024-01-24 12:04:44 -0800
commit03f76f098ada081c8ce1db25ddc9b9fc21608877 (patch)
tree40f22afe8e874de8a5705fcf7283b6f7661bfb4b /test/ruby
parent29c3ec3d49ad66c4ec9ea13735481cca598bcbcd (diff)
Fix repeated optional _ parameters
Ensure there is enough space in the local table for repeated optional parameters. Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index bccc4d4695..e5401fab9d 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -1545,6 +1545,10 @@ a
CODE
end
+ def test_repeated_optional_underscore
+ assert_prism_eval("def self.m(a, _, _, _ = 1, _ = 2, b); end; method(:m).parameters")
+ end
+
def test_repeated_required_underscore
assert_prism_eval("def self.m(a, _, _, b); end; method(:m).parameters")
end