Actions
Bug #9353
closedStruct setter methods now return the struct object rather than the value
Description
~ ruby-2.1.0 λ irb
Struct.new(:foo).new.send(:foo=, 123)
=> #
~ ruby-2.0.0-p247 λ irb
Struct.new(:foo).new.send(:foo=, 123)
=> 123
This looks like a regression introduced by r41534, where rb_struct_set was changed:
-
return ptr[i] = val;
-
return RSTRUCT_SET(obj, i, val);
The RSTRUCT_SET macro was introduced in this commit, but it returns obj, not val.
I have attached a patch fixing this issue.
Files
Actions
Like0
Like0Like0Like0Like0