From: Dave Rolsky Date: Tue, 26 Oct 2010 21:04:08 +0000 (-0500) Subject: Fix sub order so caller comes before callee X-Git-Tag: 1.18~49 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ccc2f11fdce210dac0d116afee0afb70f1db51fe;p=gitmo%2FMoose.git Fix sub order so caller comes before callee --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 1a9cbf5..d4fdd5f 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -703,22 +703,6 @@ sub _canonicalize_handles { ); } -sub _find_delegate_metaclass { - my $self = shift; - if (my $class = $self->_isa_metadata) { - # we might be dealing with a non-Moose class, - # and need to make our own metaclass. if there's - # already a metaclass, it will be returned - return Class::MOP::Class->initialize($class); - } - elsif (my $role = $self->_does_metadata) { - return Class::MOP::class_of($role); - } - else { - $self->throw_error("Cannot find delegate metaclass for attribute " . $self->name); - } -} - sub _get_delegate_method_list { my $self = shift; my $meta = $self->_find_delegate_metaclass; @@ -735,6 +719,22 @@ sub _get_delegate_method_list { } } +sub _find_delegate_metaclass { + my $self = shift; + if (my $class = $self->_isa_metadata) { + # we might be dealing with a non-Moose class, + # and need to make our own metaclass. if there's + # already a metaclass, it will be returned + return Class::MOP::Class->initialize($class); + } + elsif (my $role = $self->_does_metadata) { + return Class::MOP::class_of($role); + } + else { + $self->throw_error("Cannot find delegate metaclass for attribute " . $self->name); + } +} + sub delegation_metaclass { 'Moose::Meta::Method::Delegation' } sub _make_delegation_method {