From: Shawn M Moore Date: Sat, 28 Mar 2009 20:43:05 +0000 (-0400) Subject: class_of in ToInstance->apply X-Git-Tag: 0.73_01~36^2~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=37b3097c02ac4161c15846963bb66fd2987287db;p=gitmo%2FMoose.git class_of in ToInstance->apply --- diff --git a/lib/Moose/Meta/Role/Application/ToInstance.pm b/lib/Moose/Meta/Role/Application/ToInstance.pm index f5b64ee..4fd720b 100644 --- a/lib/Moose/Meta/Role/Application/ToInstance.pm +++ b/lib/Moose/Meta/Role/Application/ToInstance.pm @@ -29,7 +29,7 @@ sub apply { $class = $ANON_CLASSES{$anon_role_key}; } else { - my $obj_meta = eval { $object->meta } || 'Moose::Meta::Class'; + my $obj_meta = Class::MOP::class_of($object) || 'Moose::Meta::Class'; $class = $obj_meta->create_anon_class( superclasses => [ blessed($object) ] );