X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FMethod%2FInlined.pm;h=89850b8dc30c788f2d7ec52d865d9c84f75bd855;hb=b64fd605d176e851085025e08653730e38ff6a7d;hp=73de4da840a1c1704dab2452b3b6409d86494738;hpb=c298d62e8da1de920bf77577e04b4a345be03db2;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Method/Inlined.pm b/lib/Class/MOP/Method/Inlined.pm index 73de4da..89850b8 100644 --- a/lib/Class/MOP/Method/Inlined.pm +++ b/lib/Class/MOP/Method/Inlined.pm @@ -41,22 +41,6 @@ sub can_be_inlined { # compatible with the definition we are replacing it with my $expected_method = $expected_class->can( $self->name ); - my $warning - = "Not inlining '" - . $self->name - . "' for $class since it is not" - . " inheriting the default ${expected_class}::" - . $self->name . "\n"; - - if ( $self->isa("Class::MOP::Method::Constructor") ) { - - # FIXME kludge, refactor warning generation to a method - $warning - .= "If you are certain you don't need to inline your" - . " constructor, specify inline_constructor => 0 in your" - . " call to $class->meta->make_immutable\n"; - } - my $actual_method = $class->can( $self->name ) or return 1; @@ -86,6 +70,22 @@ sub can_be_inlined { return 1; } + my $warning + = "Not inlining '" + . $self->name + . "' for $class since it is not" + . " inheriting the default ${expected_class}::" + . $self->name . "\n"; + + if ( $self->isa("Class::MOP::Method::Constructor") ) { + + # FIXME kludge, refactor warning generation to a method + $warning + .= "If you are certain you don't need to inline your" + . " constructor, specify inline_constructor => 0 in your" + . " call to $class->meta->make_immutable\n"; + } + $warning .= " ('" . $self->name