fixed a method exclusion/aliasing bug
[gitmo/Moose.git] / lib / Moose / Meta / Role / Application / ToClass.pm
index d578d72..b75a263 100644 (file)
@@ -100,20 +100,20 @@ sub apply_methods {
     my ($self, $role, $class) = @_;
     foreach my $method_name ($role->get_method_list) {
         
-        next if $self->is_method_excluded($method_name);
-        
-        # it if it has one already
-        if ($class->has_method($method_name) &&
-            # and if they are not the same thing ...
-            $class->get_method($method_name)->body != $role->get_method($method_name)->body) {
-            next;
-        }
-        else {
-            # add it, although it could be overriden
-            $class->add_method(
-                $method_name,
-                $role->get_method($method_name)
-            );         
+        unless ($self->is_method_excluded($method_name)) {
+            # it if it has one already
+            if ($class->has_method($method_name) &&
+                # and if they are not the same thing ...
+                $class->get_method($method_name)->body != $role->get_method($method_name)->body) {
+                next;
+            }
+            else {
+                # add it, although it could be overriden
+                $class->add_method(
+                    $method_name,
+                    $role->get_method($method_name)
+                );         
+            }
         }
         
         if ($self->is_method_aliased($method_name)) {