diff options
author | doy <doy@tozt.net> | 2009-04-20 20:56:56 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-04-20 20:56:56 -0500 |
commit | 6e84d4f6360763e074869ff871e7d54abbb4ebcf (patch) | |
tree | 2c3e469ab1a85622f2c0361de7e798686298c61c | |
parent | 32bffd60145840cd207495ab2750a9aeca73f42d (diff) | |
download | moosex-nonmoose-6e84d4f6360763e074869ff871e7d54abbb4ebcf.tar.gz moosex-nonmoose-6e84d4f6360763e074869ff871e7d54abbb4ebcf.zip |
need to check that the constructor class's metaclass has does_role available (it'll be a cmop class if no roles were applied)
-rw-r--r-- | lib/MooseX/NonMoose/Meta/Role/Class.pm | 6 |
1 files changed, 4 insertions, 2 deletions
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) |