error_class and error_builder are readonly in immutable classes
[gitmo/Moose.git] / lib / Moose / Meta / Role / Composite.pm
index 281e9dc..c68aff5 100644 (file)
@@ -5,9 +5,9 @@ use warnings;
 use metaclass;
 
 use Carp         'confess';
-use Scalar::Util 'blessed', 'reftype';
+use Scalar::Util 'blessed';
 
-our $VERSION   = '0.01';
+our $VERSION   = '0.50';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Moose::Meta::Role';
@@ -54,8 +54,11 @@ sub alias_method {
 
     # make sure to bless the 
     # method if nessecary 
-    $method = $self->method_metaclass->wrap($method) 
-        if !blessed($method);
+    $method = $self->method_metaclass->wrap(
+        $method,
+        package_name => $self->name,
+        name         => $method_name
+    ) if !blessed($method);
 
     $self->get_method_map->{$method_name} = $method;
 }