X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FImmutable.pm;h=0fce0aa81e947eacf4c7e5c7f57a0e83aee29476;hb=403cfbeccca4e7750da88c52ad7fd81f35a7e9a7;hp=09821b229678b5c1a34e109d5cc7d391d9e17797;hpb=b92a52994ffe9a3b871a5a5526ccd6b9c9d86187;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Immutable.pm b/lib/Class/MOP/Immutable.pm index 09821b2..0fce0aa 100644 --- a/lib/Class/MOP/Immutable.pm +++ b/lib/Class/MOP/Immutable.pm @@ -9,7 +9,7 @@ use Class::MOP::Method::Constructor; use Carp 'confess'; use Scalar::Util 'blessed'; -our $VERSION = '0.80_01'; +our $VERSION = '0.82'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -97,11 +97,18 @@ sub _inline_constructor { return unless $self->options->{inline_constructor}; - return - unless $self->options->{replace_constructor} - or !$self->metaclass->has_method( - $self->options->{constructor_name} - ); + unless ($self->options->{replace_constructor} + or !$self->metaclass->has_method( + $self->options->{constructor_name} + )) { + my $class = $self->metaclass->name; + warn "Not inlining a constructor for $class since it defines" + . " its own constructor.\n" + . "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"; + return; + } my $constructor_class = $self->options->{constructor_class};