summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-11 00:28:08 -0500
committerdoy <doy@tozt.net>2009-04-11 00:28:08 -0500
commiteaf615a6387b9cf4202f9fd1d5f64225c4a06200 (patch)
treec65de357e5236c604ff9d095c8dd77b7dd6ee418 /lib
parent6da1feb2b363d4d228a4512589cf61a1aecba91c (diff)
downloadmoosex-nonmoose-eaf615a6387b9cf4202f9fd1d5f64225c4a06200.tar.gz
moosex-nonmoose-eaf615a6387b9cf4202f9fd1d5f64225c4a06200.zip
comments
Diffstat (limited to 'lib')
-rw-r--r--lib/MooseX/NonMoose.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/MooseX/NonMoose.pm b/lib/MooseX/NonMoose.pm
index 240fcb4..0db4fb6 100644
--- a/lib/MooseX/NonMoose.pm
+++ b/lib/MooseX/NonMoose.pm
@@ -17,7 +17,8 @@ sub extends {
my $caller_meta = Class::MOP::Class->initialize($caller);
# we need to get the non-moose constructor from the superclass
- # of the class where this method actually exists
+ # of the class where this method actually exists, regardless of what class
+ # we're calling it on
my $super_new = $caller_meta->find_next_method_by_name('new');
if ($super_new->associated_metaclass->can('constructor_class')) {
@@ -25,6 +26,8 @@ sub extends {
$super_new->associated_metaclass->constructor_class
);
+ # if the constructor we're inheriting is already one of ours, there's
+ # no reason to install a new one
return if $constructor_class_meta->can('does_role')
&& $constructor_class_meta->does_role('MooseX::NonMoose::Meta::Role::Constructor');
}