From c7cb212820f05695259fd0986a288c4f0ea57a55 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 31 Dec 2014 06:27:12 +0000 Subject: merge revision(s) 49041: [Backport #10659] * parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and keywords bits arguments should be unique. since internal IDs depend on the local variable index in the current scope, new ID should be made before popping those vtables. [ruby-core:67157] [Bug #10659] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_keyword.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index d24cd5b0fc..82d6407fe3 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -539,4 +539,24 @@ class TestKeywordArguments < Test::Unit::TestCase o.foo {raise "unreachable"} } end + + def test_super_with_anon_restkeywords + bug10659 = '[ruby-core:67157] [Bug #10659]' + + foo = Class.new do + def foo(**h) + h + end + end + + class << (obj = foo.new) + def foo(bar: "bar", **) + super + end + end + + assert_nothing_raised(TypeError, bug10659) { + assert_equal({:bar => "bar"}, obj.foo, bug10659) + } + end end -- cgit v1.2.3