diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-10 11:57:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-10 11:57:51 +0000 |
commit | e6f6c77d1dc368e240dcb6b827e9e868efb6c06f (patch) | |
tree | 5d2f68fa1a4f53f5b09803b1dfe7cb063ec232f2 /test | |
parent | a5beed9ff467be394afc4957f0c9b12765c81743 (diff) | |
download | ruby-e6f6c77d1dc368e240dcb6b827e9e868efb6c06f.tar.gz |
compile.c: fix lhs splat in massign
* compile.c (compile_massign_lhs): when index ends with splat,
append rhs value to it like POSTARG, since VM_CALL_ARGS_SPLAT
splats the last argument only. [ruby-core:72777] [Bug #11970]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_assignment.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb index d0f2fadeaa..daf1f0a9be 100644 --- a/test/ruby/test_assignment.rb +++ b/test/ruby/test_assignment.rb @@ -758,4 +758,12 @@ class TestAssignmentGen < Test::Unit::TestCase o = bug9448.new assert_equal("ok", o['current'] = "ok") end + + def test_massign_aref_lhs_splat + bug11970 = '[ruby-core:72777] [Bug #11970]' + h = {} + k = [:key] + h[*k], = ["ok", "ng"] + assert_equal("ok", h[:key], bug11970) + end end |