From a8c6ba23a6a95272edd6179737d4f98d7b2cdf6e Mon Sep 17 00:00:00 2001 From: Jimmy Miller Date: Wed, 29 Mar 2023 12:31:41 -0400 Subject: YJIT: Rest and keyword (non-supplying) (#7608) * YJIT: Rest and keyword (non-supplying) * Update yjit/src/codegen.rs --------- Co-authored-by: Maxime Chevalier-Boisvert --- bootstraptest/test_yjit.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 64299e004e..7a3e6e5e70 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -3800,3 +3800,18 @@ assert_equal '[{"/a"=>"b", :as=>:c, :via=>:post}, [], nil]', %q{ post "/a" => "b", as: :c } + +# Test rest and kw_args +assert_equal '[[["test"], nil, true], [["test"], :base, true]]', %q{ + def my_func(*args, base: nil, sort: true) + [args, base, sort] + end + + def calling_my_func + result = [] + result << my_func("test") + result << my_func("test", base: :base) + end + + calling_my_func +} -- cgit v1.2.1