diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-03 15:41:45 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-03 15:41:45 +0000 |
commit | ea966b6ca5623ca49a05fee3e9f9a28f1c7c5d70 (patch) | |
tree | 3265132a22b7c05b3e6844b6e6d47b589da825d5 /test | |
parent | 03228aabec1f0e036d4333dc94c7a82e3e6447f2 (diff) | |
download | ruby-ea966b6ca5623ca49a05fee3e9f9a28f1c7c5d70.tar.gz |
merge revision(s) 53495: [Backport #11970]
* 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/branches/ruby_2_3@54478 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 |