summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2024-02-16 14:31:52 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2024-02-16 15:27:49 -0500
commitb4327c115866b411cc04da9d9fe503c8edfd2f8e (patch)
treef90d28f416525d607cd24fecd5ec293fdac3cf9f /test/ruby
parentc4e30d28659fbe0dbe813b21ba8bdbd96c812a66 (diff)
YJIT: Support empty splat
Previously we rejected empty splat calls to methods with no parameters as `iseq_arity_error` which didn't work well with delegated calls.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_yjit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index b0a8337c11..3ccc1be1dd 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -1584,6 +1584,16 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
+ def test_empty_splat
+ assert_compiles(<<~'RUBY', result: %i[ok ok], no_send_fallbacks: true)
+ def foo = :ok
+ def fw(...) = foo(...)
+ def use(empty) = [foo(*empty), fw]
+
+ use([])
+ RUBY
+ end
+
private
def code_gc_helpers