Use add_conflicted_method instead of add_required_methods where
[gitmo/Moose.git] / lib / Moose / Meta / Attribute.pm
index 9b93b15..807d696 100644 (file)
@@ -7,7 +7,7 @@ use warnings;
 use Scalar::Util 'blessed', 'weaken';
 use overload     ();
 
-our $VERSION   = '0.76';
+our $VERSION   = '0.79';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use Moose::Meta::Method::Accessor;
@@ -348,7 +348,6 @@ sub _process_options {
         $class->throw_error("You can not use lazy_build and default for the same attribute ($name)", data => $options)
             if exists $options->{default};
         $options->{lazy}      = 1;
-        $options->{required}  = 1;
         $options->{builder} ||= "_build_${name}";
         if ($name =~ /^_/) {
             $options->{clearer}   ||= "_clear${name}";
@@ -620,14 +619,15 @@ sub _canonicalize_handles {
         }
     }
     else {
-        my $role_meta = Class::MOP::load_class($handles);
+        Class::MOP::load_class($handles);
+        my $role_meta = Class::MOP::class_of($handles);
 
         (blessed $role_meta && $role_meta->isa('Moose::Meta::Role'))
             || $self->throw_error("Unable to canonicalize the 'handles' option with $handles because its metaclass is not a Moose::Meta::Role", data => $handles);
 
         return map { $_ => $_ } (
             $role_meta->get_method_list,
-            $role_meta->get_required_method_list
+            map { $_->name } $role_meta->get_required_method_list,
         );
     }
 }