diff options
author | Florian Ragwitz <rafl@debian.org> | 2011-03-18 14:43:43 +0100 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2011-03-18 14:43:43 +0100 |
commit | 2b3a4e8ba0a2b77ab19e71fa382a3180b3e8d609 (patch) | |
tree | a7dc78a0482ecbe197940618e017cec1d36894ff | |
parent | 464e4d010f79373327863e232c11feac4ef9f93c (diff) | |
download | moosex-nonmoose-2b3a4e8ba0a2b77ab19e71fa382a3180b3e8d609.tar.gz moosex-nonmoose-2b3a4e8ba0a2b77ab19e71fa382a3180b3e8d609.zip |
Avoid warnings if no constructor inlining has been requested
-rw-r--r-- | lib/MooseX/NonMoose/Meta/Role/Class.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/MooseX/NonMoose/Meta/Role/Class.pm b/lib/MooseX/NonMoose/Meta/Role/Class.pm index 6c09b22..b9f9dbb 100644 --- a/lib/MooseX/NonMoose/Meta/Role/Class.pm +++ b/lib/MooseX/NonMoose/Meta/Role/Class.pm @@ -57,6 +57,10 @@ sub _determine_constructor_options { unless $cc_meta->can('does_role') && $cc_meta->does_role('MooseX::NonMoose::Meta::Role::Constructor'); + # do nothing if we explicitly ask for the constructor to not be inlined + my %options = @options; + return @options if !$options{inline_constructor}; + # XXX: get constructor name from the constructor metaclass? my $local_constructor = $self->get_method('new'); if (!defined($local_constructor)) { @@ -77,10 +81,6 @@ sub _determine_constructor_options { return @options if $local_constructor->isa('Class::MOP::Method::Wrapped'); - # do nothing if we explicitly ask for the constructor to not be inlined - my %options = @options; - return @options if !$options{inline_constructor}; - # otherwise, explicitly ask for the constructor to be replaced (to suppress # the warning message), since this is the expected usage, and shouldn't # cause a warning |