Use class_of for roles
Shawn M Moore [Sat, 28 Mar 2009 20:24:55 +0000 (16:24 -0400)]
lib/Moose/Meta/Attribute.pm

index 7d0f9c6..50079d4 100644 (file)
@@ -644,9 +644,7 @@ sub _find_delegate_metaclass {
         return Moose::Meta::Class->initialize($class);
     }
     elsif (my $role = $self->_does_metadata) {
-        # our role will always have
-        # a meta method
-        return $role->meta;
+        return Class::MOP::class_of($role);
     }
     else {
         $self->throw_error("Cannot find delegate metaclass for attribute " . $self->name);