From: Stevan Little Date: Wed, 28 May 2008 01:39:05 +0000 (+0000) Subject: initialize cleanup X-Git-Tag: 0_55~134 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=685f7e44ad45043c869354a044ce3644831796af;p=gitmo%2FMoose.git initialize cleanup --- diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 7d1d9b4..352400c 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -25,11 +25,13 @@ __PACKAGE__->meta->add_attribute('roles' => ( sub initialize { my $class = shift; my $pkg = shift; - $class->SUPER::initialize($pkg, - 'attribute_metaclass' => 'Moose::Meta::Attribute', - 'method_metaclass' => 'Moose::Meta::Method', - 'instance_metaclass' => 'Moose::Meta::Instance', - @_); + return Class::MOP::get_metaclass_by_name($pkg) + || $class->SUPER::initialize($pkg, + 'attribute_metaclass' => 'Moose::Meta::Attribute', + 'method_metaclass' => 'Moose::Meta::Method', + 'instance_metaclass' => 'Moose::Meta::Instance', + @_ + ); } sub create {