summaryrefslogtreecommitdiffstats
path: root/lib/MooseX/NonMoose
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-20 19:10:08 -0500
committerdoy <doy@tozt.net>2009-04-20 19:10:08 -0500
commitff20617797652889b66b548bd05fcd9e0e55320e (patch)
treefe984cf19697bf1cdfd516462bf717da8a291076 /lib/MooseX/NonMoose
parent92015bafc6d0f6bb4d79c029f73ec753829f20a0 (diff)
downloadmoosex-nonmoose-ff20617797652889b66b548bd05fcd9e0e55320e.tar.gz
moosex-nonmoose-ff20617797652889b66b548bd05fcd9e0e55320e.zip
support using the metaclass trait without using the constructor trait
Diffstat (limited to 'lib/MooseX/NonMoose')
-rw-r--r--lib/MooseX/NonMoose/Meta/Role/Class.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/MooseX/NonMoose/Meta/Role/Class.pm b/lib/MooseX/NonMoose/Meta/Role/Class.pm
index 73ec958..816b319 100644
--- a/lib/MooseX/NonMoose/Meta/Role/Class.pm
+++ b/lib/MooseX/NonMoose/Meta/Role/Class.pm
@@ -14,6 +14,11 @@ around _immutable_options => sub {
# do nothing if extends was never called
return $self->$orig(@_) if !$self->has_nonmoose_constructor;
+ # if we're using just the metaclass trait, but not the constructor trait,
+ # then suppress the warning about not inlining a constructor
+ return $self->$orig(inline_constructor => 0, @_)
+ unless Class::MOP::class_of($self->constructor_class)->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)
return $self->$orig(@_)