From: Shawn M Moore Date: Thu, 5 Feb 2009 02:00:36 +0000 (+0000) Subject: Settle for respecting inline_constructor for now X-Git-Tag: 0.19~57 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a1d1835c5d0080e789c2c4c91d50aef0c2a15da;p=gitmo%2FMouse.git Settle for respecting inline_constructor for now --- diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index cd23c63..5ee9049 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -145,14 +145,15 @@ sub clone_instance { sub make_immutable { my $self = shift; - my %args = @_; + my %args = ( + inline_constructor => 1, + @_, + ); + my $name = $self->name; $self->{is_immutable}++; - if ($self->name->can('new') != Mouse::Object->can('new')) { - warn "Not inlining a constructor for ".$self->name." since it is not inheriting the default Mouse::Object constructor\n"; - } - else { + if ($args{inline_constructor}) { $self->add_method('new' => Mouse::Meta::Method::Constructor->generate_constructor_method_inline( $self )); }