From: Shawn M Moore Date: Sat, 28 Mar 2009 22:45:52 +0000 (-0400) Subject: Don't only conditionally use load_class since.. X-Git-Tag: 0.73_01~33 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b121c2c8507434e24713ac221ffcf760c40e3d3;p=gitmo%2FMoose.git Don't only conditionally use load_class since.. we need the metaclass (which load_class gives us) and load_class already checks is_class_loaded --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 50079d4..3ee8bcf 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -620,10 +620,7 @@ sub _canonicalize_handles { } } else { - Class::MOP::load_class($handles) - unless Class::MOP::is_class_loaded($handles); - - my $role_meta = Class::MOP::class_of($handles); + my $role_meta = Class::MOP::load_class($handles); (blessed $role_meta && $role_meta->isa('Moose::Meta::Role')) || $self->throw_error("Unable to canonicalize the 'handles' option with $handles because its metaclass is not a Moose::Meta::Role", data => $handles);