Use Moose::Util::throw in lib/Moose instead of confess
[gitmo/Moose.git] / lib / Moose / Meta / Role.pm
index 0f96d22..491af7c 100644 (file)
@@ -6,7 +6,6 @@ use metaclass;
 
 use Class::Load qw(load_class);
 use Scalar::Util 'blessed';
-use Carp         'confess';
 use Devel::GlobalDestruction 'in_global_destruction';
 
 use Moose::Meta::Class;
@@ -503,15 +502,15 @@ sub create {
     my %options = @args;
 
     (ref $options{attributes} eq 'HASH')
-        || confess "You must pass a HASH ref of attributes"
+        || Moose::Util::throw "You must pass a HASH ref of attributes"
             if exists $options{attributes};
 
     (ref $options{methods} eq 'HASH')
-        || confess "You must pass a HASH ref of methods"
+        || Moose::Util::throw "You must pass a HASH ref of methods"
             if exists $options{methods};
 
     (ref $options{roles} eq 'ARRAY')
-        || confess "You must pass an ARRAY ref of roles"
+        || Moose::Util::throw "You must pass an ARRAY ref of roles"
             if exists $options{roles};
 
     my $package      = delete $options{package};
@@ -904,6 +903,31 @@ This is quite likely to change in the future.
 
 =back
 
+=head2 Overload introspection and creation
+
+The methods for dealing with a role's overloads are all identical in API
+and behavior to the same methods in L<Class::MOP::Class>. Note that these are
+not particularly useful (yet), because overloads do not participate in role
+composition.
+
+=over 4
+
+=item B<< $metarole->is_overloaded >>
+
+=item B<< $metarole->get_overloaded_operator($op) >>
+
+=item B<< $metarole->has_overloaded_operator($op) >>
+
+=item B<< $metarole->get_overload_list >>
+
+=item B<< $metarole->get_all_overloaded_operators >>
+
+=item B<< $metarole->add_overloaded_operator($op, $impl) >>
+
+=item B<< $metarole->remove_overloaded_operator($op) >>
+
+=back
+
 =head2 Required methods
 
 =over 4