Actions
Bug #1744
closedError with Marshal dump/load on a delegated class.
Bug #1744:
Error with Marshal dump/load on a delegated class.
Description
=begin
Instance variables are not handled when using Marshal with a delegated class.
Here is an example :
on Ruby 1.8, the instance variable @var will be copied fine.
on Ruby 1.9.1, it is set to nil.
It seems to only occur with class inherited from DelegateClass.
==================================
require 'delegate'
class C < DelegateClass(Integer)
attr_accessor :var
def initialize
@var = 1
end
end
c = C.new
p c.var # => 1
d = Marshal.load(Marshal.dump(c))
p d.var # => nil on Ruby 1.9¶
=end
Files
Actions