From: Jesse Luehrs Date: Mon, 9 May 2011 22:21:22 +0000 (-0500) Subject: revert this, the bump from 0.12 to 0.28 breaks backcompat X-Git-Tag: 2.0006~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f9da0b754f8d32e3a6441a98c7feae81a48b9cd;p=gitmo%2FMoose.git revert this, the bump from 0.12 to 0.28 breaks backcompat --- diff --git a/dist.ini b/dist.ini index ed1e998..9466d16 100644 --- a/dist.ini +++ b/dist.ini @@ -72,7 +72,7 @@ directory = benchmarks Data::OptList = 0.107 Devel::GlobalDestruction = 0 Eval::Closure = 0.04 -List::MoreUtils = 0.28 +List::MoreUtils = 0.12 MRO::Compat = 0.05 Package::DeprecationManager = 0.10 Package::Stash = 0.21 diff --git a/lib/Moose/Meta/Role/Application/ToInstance.pm b/lib/Moose/Meta/Role/Application/ToInstance.pm index 1f12e5f..4343670 100644 --- a/lib/Moose/Meta/Role/Application/ToInstance.pm +++ b/lib/Moose/Meta/Role/Application/ToInstance.pm @@ -5,7 +5,6 @@ use warnings; use metaclass; use Scalar::Util 'blessed'; -use List::MoreUtils 'all'; use base 'Moose::Meta::Role::Application'; @@ -25,10 +24,13 @@ sub apply { $obj_meta = 'Moose::Meta::Class' unless $obj_meta->isa('Moose::Meta::Class'); + my $cache = 1; + undef $cache if grep { $_ ne '-alias' && $_ ne '-excludes' } keys %$args; + my $class = $obj_meta->create_anon_class( superclasses => [ blessed($object) ], roles => [ $role, keys(%$args) ? ($args) : () ], - cache => (all { $_ eq '-alias' || $_ eq '-excludes' } keys %$args), + cache => $cache, ); $class->rebless_instance( $object, %{ $self->rebless_params } );