From 27dfc398a8cd3b63ccc527c914dee5edd696790e Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 25 Jan 2014 05:21:07 +0000 Subject: 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 --- test/ruby/test_assignment.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3