From d0567cfe08a19d7a488f7a24a1d7d92c33663c14 Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 11 Apr 2009 17:12:24 -0500 Subject: extends shouldn't do anything special to the constructor if it would otherwise just be calling a moose constructor --- lib/MooseX/NonMoose.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/MooseX/NonMoose.pm b/lib/MooseX/NonMoose.pm index 0db4fb6..1d76f52 100644 --- a/lib/MooseX/NonMoose.pm +++ b/lib/MooseX/NonMoose.pm @@ -21,6 +21,9 @@ sub extends { # we're calling it on my $super_new = $caller_meta->find_next_method_by_name('new'); + # if we're trying to extend a moose class, just do nothing + return if $super_new->package_name eq 'Moose::Object'; + if ($super_new->associated_metaclass->can('constructor_class')) { my $constructor_class_meta = Class::MOP::Class->initialize( $super_new->associated_metaclass->constructor_class -- cgit v1.2.3-54-g00ecf