From c2197bf82171ca2dad6f7ef67521fdd30a245d9c Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 16 Dec 2021 15:08:07 -0800 Subject: YJIT: Fix check for required kwargs Previously, YJIT would not check that all the required keywords were specified in the case that there were optional arguments specified. In this case YJIT would incorrectly call the method with invalid arguments. --- bootstraptest/test_yjit.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 501f00d5b3..05947c48ed 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -2234,6 +2234,14 @@ assert_equal '[:ok]', %q{ 5.times.map { kwargs() rescue :ok }.uniq } +assert_equal '[:ok]', %q{ + def kwargs(a:, b: nil) + value + end + + 5.times.map { kwargs(b: 123) rescue :ok }.uniq +} + assert_equal '[[1, 2]]', %q{ def kwargs(left:, right:) [left, right] -- cgit v1.2.3