Issue #5247 has been reported by Lin Jen-Shin.

----------------------------------------
Bug #5247: Marshal.load didn't call correct initialize method of subclasses of a struct
http://redmine.ruby-lang.org/issues/5247

Author: Lin Jen-Shin
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: Ruby 1.8.7
ruby -v: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]


It's ok in 1.9:

> ruby -ve 'class C<Struct.new(:a);def initialize;end;end;p Marshal.load(Marshal.dump(C.new))'
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
#<struct C a=nil>

But wrong in 1.8:

ruby-1.8 -ve 'class C<Struct.new(:a);def initialize;end;end;p Marshal.load(Marshal.dump(C.new))'
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
-e:1:in `initialize': wrong number of arguments (1 for 0) (ArgumentError)
	from -e:1:in `load'
	from -e:1


-- 
http://redmine.ruby-lang.org