diff options
author | John Hawthorn <john@hawthorn.email> | 2021-12-16 15:08:07 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2021-12-17 15:26:04 -0800 |
commit | c2197bf82171ca2dad6f7ef67521fdd30a245d9c (patch) | |
tree | e8633d5b70c9be9792cd9e9033d72e4a8763400a /bootstraptest | |
parent | 83aa68447c87169b3610b6e04abebdcc592f0c16 (diff) | |
download | ruby-c2197bf82171ca2dad6f7ef67521fdd30a245d9c.tar.gz |
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.
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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] |