classFoodeftestTESTendendBar1=Foo.cloneBar2=Foo.cloneclassBar1TEST='bar-1'endclassBar2TEST='bar-2'end# If these two lines are reordered, 'bar-2' is produced each timep[:bar1_method,Bar1.new.test]# outputs 'bar-1' (correct)p[:bar2_method,Bar2.new.test]# outputs 'bar-1' (incorrect)p[:bar1_const,Bar1::TEST]# outputs 'bar-1' (correct)p[:bar2_const,Bar2::TEST]# outputs 'bar-2' (correct)
I tested this on 2.5, 2.4 and the behavior is the same there. Also this applies to subclasses as well. The first class READ determines the values for all of them.
Without this patch, "raise" event invoked twice when raise an
exception in "load"ed script.
This patch by danielwaterworth (Daniel Waterworth).
[Bug #15877]
Methods on duplicated class/module refer same constant inline
cache (IC). Constant access lookup should be done for cloned
class/modules but inline cache doesn't check it.
To check it, this patch introduce new RCLASS_CLONED flag which
are set when if class/module is cloned (both orig and dst).
[Bug #15877]