Subject: | MooseX::NonMoose::Meta::Role::Class broken if new not existant |
MooseX::NonMoose::Meta::Role::Class dies if the class which uses
MooseX::NonMoose has no method "new" with eg,
--snip--
Can't call method "isa" on an undefined value at
/usr/local/share/perl/5.10.1/MooseX/NonMoose/Meta/Role/Class.pm line 40.
--snap--
The following code:
return @options
if $self->get_method('new')->isa('Class::MOP::Method::Wrapped');
should be changed to use $metaclass->has_method to check
first or using $metaclass->find_method_by_name if your intention for new
is to be in a superclass.
I think this method should never die if the method new is not existant.
Maybe you could add a warning, that it may doesn't work as expected, if
no new method can be found.
Most info/text parts were originally written by Alejandrpo Imass, see
http://article.gmane.org/gmane.comp.web.catalyst.general/25951