We don't need the metametaclass, we just want to operate on the metaclass
Shawn M Moore [Sun, 9 Nov 2008 05:22:18 +0000 (05:22 +0000)]
lib/MooseX/Role/Parameterized/Meta/Role.pm

index 0aa0f21..7aa5703 100644 (file)
@@ -42,15 +42,15 @@ sub generate_role {
     my $metaclass = Moose::Meta::Class->create_anon_class(
         superclasses => ['Moose::Meta::Role'],
     );
+    my $role = $metaclass->construct_instance;
 
     my $parameters = $self->construct_parameters(%args);
 
-    local $MooseX::Role::Parameterized::CURRENT_METACLASS = $metaclass;
+    local $MooseX::Role::Parameterized::CURRENT_METACLASS = $role;
     $self->role_generator->($parameters,
-        operating_on => $metaclass,
+        operating_on => $role,
     );
 
-    my $role = $metaclass->construct_instance;
     return $role;
 }