Issue #8041 has been updated by nobu (Nobuyoshi Nakada).

Description updated

To be honest, I haven't considered about marshaling prepended objects at all.
How could we represent it?

(1) add new type, TYPE_PREEXTEND for example.
(2) allow the current dumped format and treat the class in extending modules as the mark of prepend.

The former may need marshal version to bump up, I don't want it.

----------------------------------------
Bug #8041: Marshal incompatibility with prepend
https://bugs.ruby-lang.org/issues/8041#change-37383

Author: marcandre (Marc-Andre Lafortune)
Status: Open
Priority: Low
Assignee: 
Category: core
Target version: current: 2.1.0
ruby -v: r39629


=begin
Marshal doesn't work for objects with prepended modules:

    o = Object.new
    o.singleton_class.send :include, Enumerable
    Marshal.load(Marshal.dump(o)) # => ok

    o = Object.new
    o.singleton_class.send :prepend, Enumerable
    Marshal.load(Marshal.dump(o)) # => ArgumentError: Object does not refer to module
=end


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