summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_keyword.rb9
-rw-r--r--version.h2
-rw-r--r--vm_method.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index 8ec0636d5c..03f539fc72 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -2366,6 +2366,11 @@ class TestKeywordArguments < Test::Unit::TestCase
baz(*args)
end
+ define_method(:block_splat) {|*args| }
+ ruby2_keywords :block_splat, def foo_bar_after_bmethod(*args)
+ bar(*args)
+ end
+
ruby2_keywords def foo_baz2(*args)
baz(*args)
baz(*args)
@@ -2501,6 +2506,7 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal([1, h1], o.foo(:foo_baz, 1, :a=>1))
assert_equal([[1], h1], o.foo_foo_bar(1, :a=>1))
assert_equal([1, h1], o.foo_foo_baz(1, :a=>1))
+ assert_equal([[1], h1], o.foo_bar_after_bmethod(1, :a=>1))
assert_equal([[1], h1], o.foo(:bar, 1, **h1))
assert_equal([1, h1], o.foo(:baz, 1, **h1))
@@ -2516,6 +2522,7 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal([1, h1], o.foo(:foo_baz, 1, **h1))
assert_equal([[1], h1], o.foo_foo_bar(1, **h1))
assert_equal([1, h1], o.foo_foo_baz(1, **h1))
+ assert_equal([[1], h1], o.foo_bar_after_bmethod(1, **h1))
assert_equal([[h1], {}], o.foo(:bar, h1, **{}))
assert_equal([h1], o.foo(:baz, h1, **{}))
@@ -2531,6 +2538,7 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal([h1], o.foo(:foo_baz, h1, **{}))
assert_equal([[h1], {}], o.foo_foo_bar(h1, **{}))
assert_equal([h1], o.foo_foo_baz(h1, **{}))
+ assert_equal([[h1], {}], o.foo_bar_after_bmethod(h1, **{}))
assert_equal([[1, h1], {}], o.foo(:bar, 1, h1))
assert_equal([1, h1], o.foo(:baz, 1, h1))
@@ -2540,6 +2548,7 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal([1, h1], o.store_foo(:baz, 1, h1))
assert_equal([[1, h1], {}], o.foo_bar(1, h1))
assert_equal([1, h1], o.foo_baz(1, h1))
+ assert_equal([[1, h1], {}], o.foo_bar_after_bmethod(1, h1))
assert_equal([[1, h1, 1], {}], o.foo_mod(:bar, 1, :a=>1))
assert_equal([1, h1, 1], o.foo_mod(:baz, 1, :a=>1))
diff --git a/version.h b/version.h
index a42fc5c201..1b86753efe 100644
--- a/version.h
+++ b/version.h
@@ -12,7 +12,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 24
+#define RUBY_PATCHLEVEL 25
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 2
diff --git a/vm_method.c b/vm_method.c
index e77f0a9678..e545146df9 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -2198,7 +2198,7 @@ rb_mod_ruby2_keywords(int argc, VALUE *argv, VALUE module)
else {
rb_warn("Skipping set of ruby2_keywords flag for %s (method accepts keywords or method does not accept argument splat)", rb_id2name(name));
}
- return Qnil;
+ break;
}
}
/* fallthrough */