Need to ignore override and super in the method list
[gitmo/Mouse.git] / lib / Mouse / Meta / Class.pm
index cd23c63..93b6f6c 100644 (file)
@@ -76,7 +76,7 @@ sub get_method_list {
     no strict 'refs';
     # Get all the CODE symbol table entries
     my @functions =
-      grep !/^(?:has|with|around|before|after|blessed|extends|confess)$/,
+      grep !/^(?:has|with|around|before|after|blessed|extends|confess|override|super)$/,
       grep { defined &{"${name}::$_"} }
       keys %{"${name}::"};
     push @functions, keys %{$self->{'methods'}->{$name}};
@@ -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 ));
     }