Fix the is_needed method to actually check the right thing.
Dave Rolsky [Mon, 6 Apr 2009 16:41:50 +0000 (11:41 -0500)]
lib/Moose/Meta/Method/Destructor.pm

index 1f5cc87..93d7f83 100644 (file)
@@ -57,7 +57,7 @@ sub is_needed {
         || $self->throw_error(
         "The is_needed method expected a metaclass object as its arugment");
 
-    return Class::MOP::class_of($metaclass)->can('DEMOLISH');
+    return $metaclass->find_next_method_by_name('DEMOLISH');
 }
 
 sub initialize_body {