From 6a37b8cde38465a72991579e660d435faaa006ab Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 1 Jan 2015 00:14:23 +0000 Subject: vm_args.c: fix non-symbol keys hash * vm_args.c (keyword_hash_p): fix non-symbol keys hash. rb_extract_keywords() returns 0 not Qnil when no symbol keys is included. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_keyword.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index 82d6407fe3..70cdba1db2 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -559,4 +559,11 @@ class TestKeywordArguments < Test::Unit::TestCase assert_equal({:bar => "bar"}, obj.foo, bug10659) } end + + def m(a) yield a end + + def test_nonsymbol_key + result = m(["a" => 10]) { |a = nil, **b| [a, b] } + assert_equal([{"a" => 10}, {}], result) + end end -- cgit v1.2.3