tckect #42992: Method modifiers affect all classes in the whole inheritance tree
Tokuhiro Matsuno [Sat, 11 Apr 2009 15:44:24 +0000 (00:44 +0900)]
was resolved by patch from gfx++

lib/Mouse/Meta/Role.pm
t/000-recipes/002_schwartz_tutorial.t

index 5dccbdc..709c3f9 100644 (file)
@@ -101,7 +101,7 @@ sub apply {
                 # XXX what's Moose's behavior?
                 #next;
             } else {
-                *$class_function = *$role_function;
+                *{$class_function} = \&{$role_function};
             }
             if ($args{alias} && $args{alias}->{$name}) {
                 my $dstname = $args{alias}->{$name};
index c23715e..c15003e 100755 (executable)
@@ -125,7 +125,6 @@ is stdout, "Mr. Ed\n";
 $talking->color("grey");        # sets the color
 $talking->speak;                # says "Mr. Ed goes neigh"
 
-TODO: { local $TODO = "this currently fails because of a bug in Class::Method::Modifiers (see RT #42992)";
 is stdout, <<EXPECTED;
 Mr. Ed goes neigh
 EXPECTED
@@ -137,7 +136,6 @@ $baab->speak;                   # prints "Baab goes baaaah"
 is stdout, <<EXPECTED;
 Baab goes baaaah
 EXPECTED
-    }
 
 #use MouseA
 my $mickey = MouseA->new(name => 'Mickey');