ruby-changes:65364
From: usa <ko1@a...>
Date: Sun, 28 Feb 2021 23:32:08 +0900 (JST)
Subject: [ruby-changes:65364] 348a909ab9 (ruby_2_6): * vm_args.c (setup_parameters_complex): no longer need to warn splat
https://git.ruby-lang.org/ruby.git/commit/?id=348a909ab9 From 348a909ab9fe4ec26cdf5e198a6621205f9656d3 Mon Sep 17 00:00:00 2001 From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Sun, 28 Feb 2021 14:31:52 +0000 Subject: * vm_args.c (setup_parameters_complex): no longer need to warn splat hash in a pattern. [Backport #16632][Bacport #16950] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_keyword.rb | 6 ------ version.h | 2 +- vm_args.c | 11 ----------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index 84a5cfe..8e2da53 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -520,12 +520,6 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L520 assert_equal(:ok, m.f(*a, **o), '[ruby-core:83638] [Bug #10856]') o = {a: 42} - assert_warning(/splat keyword/, 'splat to mandatory') do - assert_equal({a: 42}, m.f1(**o)) - end - assert_warning(/splat keyword/) do - assert_equal({a: 42}, m.f2(**o), '[ruby-core:82280] [Bug #13791]') - end assert_warning('', 'splat to kwrest') do assert_equal({a: 42}, m.f3(**o)) end diff --git a/version.h b/version.h index bcfe99a..a4964a7 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1 #define RUBY_VERSION "2.6.7" #define RUBY_RELEASE_DATE "2021-02-28" -#define RUBY_PATCHLEVEL 158 +#define RUBY_PATCHLEVEL 159 #define RUBY_RELEASE_YEAR 2021 #define RUBY_RELEASE_MONTH 2 diff --git a/vm_args.c b/vm_args.c index 299ed16..2e70ed3 100644 --- a/vm_args.c +++ b/vm_args.c @@ -685,17 +685,6 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co https://github.com/ruby/ruby/blob/trunk/vm_args.c#L685 else if (!NIL_P(keyword_hash) && RHASH_SIZE(keyword_hash) > 0) { argument_kw_error(ec, iseq, "unknown", rb_hash_keys(keyword_hash)); } - else if (kw_splat && NIL_P(keyword_hash)) { - if (RTEST(ruby_verbose)) { - VALUE path = rb_iseq_path(iseq); - VALUE line = rb_iseq_first_lineno(iseq); - VALUE label = rb_iseq_label(iseq); - rb_compile_warning(NIL_P(path) ? NULL : RSTRING_PTR(path), FIX2INT(line), - "in `%s': the last argument was passed as a single Hash", - NIL_P(label) ? NULL : RSTRING_PTR(label)); - rb_warning("although a splat keyword arguments here"); - } - } if (iseq->body->param.flags.has_block) { if (iseq->body->local_iseq == iseq) { -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/