summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-25 05:21:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-25 05:21:07 +0000
commit27dfc398a8cd3b63ccc527c914dee5edd696790e (patch)
treeae95b95d1f0af5bc477ce6c340f39b4f9ab39afc /test/ruby
parent7b8dc95b3a450b8f20049061054df0d1fc637239 (diff)
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.rb10
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