From: Shawn M Moore Date: Sun, 8 Mar 2009 07:52:48 +0000 (-0400) Subject: Semi-hack to fix the rebless + overload behavior on 5.8 X-Git-Tag: 0.78_01~86 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=feb93c857e28446bcf4916360fad41640828963d;p=gitmo%2FClass-MOP.git Semi-hack to fix the rebless + overload behavior on 5.8 --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index cc615f9..7a7b1f2 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -427,7 +427,8 @@ sub rebless_instance { || confess "You may rebless only into a subclass of (". $old_metaclass->name ."), of which (". $self->name .") isn't."; # rebless! - $meta_instance->rebless_instance_structure($instance, $self); + # we use $_[1] here because of t/306_rebless_overload.t regressions on 5.8.8 + $meta_instance->rebless_instance_structure($_[1], $self); foreach my $attr ( $self->compute_all_applicable_attributes ) { if ( $attr->has_value($instance) ) { diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 36aa833..bf37523 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -154,7 +154,9 @@ sub strengthen_slot_value { sub rebless_instance_structure { my ($self, $instance, $metaclass) = @_; - bless $instance, $metaclass->name; + + # we use $_[1] here because of t/306_rebless_overload.t regressions on 5.8.8 + bless $_[1], $metaclass->name; } sub is_dependent_on_superclasses {