From 2b3a4e8ba0a2b77ab19e71fa382a3180b3e8d609 Mon Sep 17 00:00:00 2001 From: Florian Ragwitz Date: Fri, 18 Mar 2011 14:43:43 +0100 Subject: Avoid warnings if no constructor inlining has been requested --- lib/MooseX/NonMoose/Meta/Role/Class.pm | 8 ++++---- 1 file 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 -- cgit v1.2.3