diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-09 06:26:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-09 06:26:15 +0000 |
commit | f4c52b483cb4794e3e0e526a084cdbd32da8086c (patch) | |
tree | 9bb6b87176fd2c1f03723733ef90eeafb5adc3af /test | |
parent | 0a4ed02461f9a7fee0da33282a6ede600b90e928 (diff) | |
download | ruby-f4c52b483cb4794e3e0e526a084cdbd32da8086c.tar.gz |
compile.c: append keyword hash to splat
* compile.c (iseq_compile_each): append keyword hash to argument array
to splat if needed. [ruby-core:54094] [Bug #8236]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_keyword.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index dc20c6d7fd..c9a9ed0a07 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -327,4 +327,25 @@ class TestKeywordArguments < Test::Unit::TestCase assert_raise(ArgumentError, bug8139) {b.call(c: bug8139)} assert_raise(ArgumentError, bug8139) {b.call} end + + def test_super_with_keyword + bug8236 = '[ruby-core:54094] [Bug #8236]' + base = Class.new do + def foo(*args) + args + end + end + a = Class.new(base) do + def foo(arg, bar: 'x') + super + end + end + b = Class.new(base) do + def foo(*args, bar: 'x') + super + end + end + assert_equal([42, {:bar=>"x"}], a.new.foo(42), bug8236) + assert_equal([42, {:bar=>"x"}], b.new.foo(42), bug8236) + end end |