diff options
author | John Hawthorn <john@hawthorn.email> | 2021-11-01 07:54:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-01 10:54:59 -0400 |
commit | 2fa51c70683ef8198bddb3332eb62c9239cbde8f (patch) | |
tree | 02512af978cf67df3f2ad0b59665f17e0f34c571 /bootstraptest | |
parent | b474049c78dc8d6e24aec4c8073240b61b6869f7 (diff) |
YJIT: Support kwargs sends with all defaults (#5067)
* YJIT: Support kwargs sends with all defaults
Previously keyword argument methods were only compiled by YJIT when all
keywords were specified in the caller.
This adds support for calling methods with keyword arguments when no
keyword arguments are specified and all are filled with the defaults.
* Remove unused send_iseq_kwargs_none_passed
Notes
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 0a3aa81860..13d63b521c 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -2165,6 +2165,28 @@ assert_equal '[2]', %q{ 5.times.map { default_expression(value: 2) }.uniq } +# constant default values on keywords +assert_equal '[3]', %q{ + def default_expression(value: 3) + value + end + + 5.times.map { default_expression }.uniq +} + +# non-constant default values on keywords +assert_equal '[3]', %q{ + def default_value + 3 + end + + def default_expression(value: default_value) + value + end + + 5.times.map { default_expression }.uniq +} + # attr_reader on frozen object assert_equal 'false', %q{ class Foo |