Revision history for Perl extension Class-MOP.
+ * Class::MOP::Method
+ - Fix bug from MooseX::Types passing blessed code references
+
0.89
* Class::MOP::Instance
- add inline version of rebless_instance_structure. (doy)
use warnings;
use Carp 'confess';
-use Scalar::Util 'weaken';
+use Scalar::Util 'weaken', 'reftype';
our $VERSION = '0.88';
$VERSION = eval $VERSION;
my %params = @args;
my $code = $params{body};
- ('CODE' eq ref($code))
+ (ref $code && 'CODE' eq reftype($code))
|| confess "You must supply a CODE reference to bless, not (" . ($code || 'undef') . ")";
($params{package_name} && $params{name})
use strict;
use warnings;
-use Test::More tests => 46;
+use Test::More tests => 47;
use Test::Exception;
use Class::MOP;
Class::MOP::Method->wrap(sub { 'FAIL' }, name => '__ANON__')
} '... bad args for &wrap';
+lives_ok {
+ Class::MOP::Method->wrap(bless(sub { 'FAIL' }, "Foo"), name => '__ANON__', package_name => 'Foo::Bar')
+} '... blessed coderef to &wrap';
+
my $clone = $method->clone(
package_name => 'NewPackage',
name => 'new_name',