From: Hans Dieter Pearcey Date: Thu, 25 Jun 2009 21:27:57 +0000 (-0400) Subject: default more helpfully X-Git-Tag: 0.89_02~135 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4adb0e7b7322205543720564b209a422f0b15491;p=gitmo%2FMoose.git default more helpfully --- diff --git a/lib/Moose/Meta/Method/Delegation.pm b/lib/Moose/Meta/Method/Delegation.pm index 2fadd19..205018c 100644 --- a/lib/Moose/Meta/Method/Delegation.pm +++ b/lib/Moose/Meta/Method/Delegation.pm @@ -36,13 +36,12 @@ sub new { || confess 'You must supply a delegate_to_method which is a method name or a CODE reference'; - ( !exists $options{curried_arguments} || ( - $options{curried_arguments} && - ( 'ARRAY' eq ref $options{curried_arguments} ) - ) ) || confess - 'You must supply a curried_arguments which is an ARRAY reference'; + exists $options{curried_arguments} + || ( $options{curried_arguments} = [] ); - $options{curried_arguments} ||= []; + ( $options{curried_arguments} && + ( 'ARRAY' eq ref $options{curried_arguments} ) ) + || confess 'You must supply a curried_arguments which is an ARRAY reference'; my $self = $class->_new( \%options );