From b4327c115866b411cc04da9d9fe503c8edfd2f8e Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Fri, 16 Feb 2024 14:31:52 -0500 Subject: 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. --- test/ruby/test_yjit.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3