From 6e84d4f6360763e074869ff871e7d54abbb4ebcf Mon Sep 17 00:00:00 2001 From: doy Date: Mon, 20 Apr 2009 20:56:56 -0500 Subject: need to check that the constructor class's metaclass has does_role available (it'll be a cmop class if no roles were applied) --- lib/MooseX/NonMoose/Meta/Role/Class.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/MooseX/NonMoose') diff --git a/lib/MooseX/NonMoose/Meta/Role/Class.pm b/lib/MooseX/NonMoose/Meta/Role/Class.pm index 6e5c6e0..2bffa30 100644 --- a/lib/MooseX/NonMoose/Meta/Role/Class.pm +++ b/lib/MooseX/NonMoose/Meta/Role/Class.pm @@ -18,8 +18,10 @@ around _immutable_options => sub { # if we're using just the metaclass trait, but not the constructor trait, # then suppress the warning about not inlining a constructor - return (inline_constructor => 0, @options) - unless Class::MOP::class_of($self->constructor_class)->does_role('MooseX::NonMoose::Meta::Role::Constructor'); + my $cc_meta = Class::MOP::class_of($self->constructor_class); + return (@options, inline_constructor => 0) + unless $cc_meta->can('does_role') + && $cc_meta->does_role('MooseX::NonMoose::Meta::Role::Constructor'); # do nothing if extends was called, but we then added a method modifier to # the constructor (this will warn, but that's okay) -- cgit v1.2.3-54-g00ecf