From: Shawn M Moore Date: Sat, 28 Mar 2009 21:29:29 +0000 (-0400) Subject: class_of Util::apply_all_roles 2/2 X-Git-Tag: 0.73_01~36^2~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d27ee95015137f217721e02121a92c90e63a19d;p=gitmo%2FMoose.git class_of Util::apply_all_roles 2/2 --- diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index ed9f398..66b0bc6 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -98,7 +98,8 @@ sub apply_all_roles { if ( scalar @$roles == 1 ) { my ( $role, $params ) = @{ $roles->[0] }; - $role->meta->apply( $meta, ( defined $params ? %$params : () ) ); + my $role_meta = Class::MOP::class_of($role); + $role_meta->apply( $meta, ( defined $params ? %$params : () ) ); } else { Moose::Meta::Role->combine( @$roles )->apply($meta);