From: Peter Rabbitson Date: Thu, 24 Feb 2011 18:01:00 +0000 (+0000) Subject: Stupid regression - the primitive $isa{$_} does not take in consideration the ISA... X-Git-Tag: v1.001000~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1950a66337b4572634e4b99cd57a702398889c2;p=p5sagit%2FClass-C3-Componentised.git Stupid regression - the primitive $isa{$_} does not take in consideration the ISA of added parents --- diff --git a/Changes b/Changes index 5a5a1e4..dddd8a0 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Class-C3-Componentised + Fix inject_base regression introduced during optimizations in + 1.0007 + 1.0007 23 Feb 2011 Throw a readable exception when load_optional_class is given an invalid class name diff --git a/lib/Class/C3/Componentised.pm b/lib/Class/C3/Componentised.pm index 5506a15..1f85d67 100644 --- a/lib/Class/C3/Componentised.pm +++ b/lib/Class/C3/Componentised.pm @@ -188,13 +188,10 @@ sub inject_base { my $class = shift; my $target = shift; - my %isa = map { $_ => 1 } ($target, @{mro::get_linear_isa($target)} ); - for (reverse @_) { no strict 'refs'; - unless ($isa{$_}++) { - unshift ( @{"${target}::ISA"}, $_ ); - } + unshift ( @{"${target}::ISA"}, $_ ) + unless ($target eq $_ || $target->isa($_)); } mro::set_mro($target, 'c3');