diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-04 13:44:34 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-04 13:44:34 +0000 |
commit | 306c154c2d0010cebd600175f3f70083fc787599 (patch) | |
tree | 8dce16352c3689266473d690c159322a60f8c366 /struct.c | |
parent | 54f6b3fe826f49ad245db65f692cfc6096706bd3 (diff) | |
download | bundler-306c154c2d0010cebd600175f3f70083fc787599.tar.gz |
* struct.c (rb_struct_set): return assigned value from setter method
rather than struct object. [Bug #9353] [ruby-core:59509]
* test/ruby/test_struct.rb (test_setter_method_returns_value): add test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -156,7 +156,8 @@ rb_struct_set(VALUE obj, VALUE val) for (i=0; i<len; i++) { slot = RARRAY_AREF(members, i); if (rb_id_attrset(SYM2ID(slot)) == rb_frame_this_func()) { - return RSTRUCT_SET(obj, i, val); + RSTRUCT_SET(obj, i, val); + return val; } } rb_name_error(rb_frame_this_func(), "`%s' is not a struct member", |