[Moose-commits] r7550 - Mouse/trunk/lib/Mouse/Meta

sartak at code2.0beta.co.uk sartak at code2.0beta.co.uk
Thu Feb 5 02:00:37 GMT 2009


Author: sartak
Date: 2009-02-04 18:00:36 -0800 (Wed, 04 Feb 2009)
New Revision: 7550

Modified:
   Mouse/trunk/lib/Mouse/Meta/Class.pm
Log:
Settle for respecting inline_constructor for now

Modified: Mouse/trunk/lib/Mouse/Meta/Class.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Class.pm	2009-02-05 02:00:29 UTC (rev 7549)
+++ Mouse/trunk/lib/Mouse/Meta/Class.pm	2009-02-05 02:00:36 UTC (rev 7550)
@@ -145,14 +145,15 @@
 
 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 ));
     }
 




More information about the Moose-commits mailing list