->wrap is documented as a constructor, so it should expect a class name as the first...
Dave Rolsky [Wed, 3 Dec 2008 00:23:30 +0000 (00:23 +0000)]
lib/Class/MOP/Method.pm

index 4581498..a619c2b 100644 (file)
@@ -43,7 +43,7 @@ sub wrap {
     ($params{package_name} && $params{name})
         || confess "You must supply the package_name and name parameters $UPGRADE_ERROR_TEXT";
 
-    my $self = (ref($class) || $class)->_new(\%params);
+    my $self = $class->_new(\%params);
 
     weaken($self->{associated_metaclass}) if $self->{associated_metaclass};