diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-25 05:21:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-25 05:21:07 +0000 |
commit | 27dfc398a8cd3b63ccc527c914dee5edd696790e (patch) | |
tree | ae95b95d1f0af5bc477ce6c340f39b4f9ab39afc /test/ruby | |
parent | 7b8dc95b3a450b8f20049061054df0d1fc637239 (diff) | |
download | ruby-27dfc398a8cd3b63ccc527c914dee5edd696790e.tar.gz |
compile.c: assignment result of aset_with
* compile.c (iseq_compile_each): result of assignment should be
its rhs instead of returned value from a method.
[ruby-core:60071] [Bug #9448]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_assignment.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb index e38b20b285..df646df429 100644 --- a/test/ruby/test_assignment.rb +++ b/test/ruby/test_assignment.rb @@ -692,4 +692,14 @@ class TestAssignmentGen < Test::Unit::TestCase check(assign) } end + + def test_optimized_aset + bug9448 = Class.new do + def []=(key, new_value) + '[ruby-core:60071] [Bug #9448]' + end + end + o = bug9448.new + assert_equal("ok", o['current'] = "ok") + end end |