summaryrefslogtreecommitdiffstats
path: root/lib/MooseX/NonMoose/Meta/Role/Class.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MooseX/NonMoose/Meta/Role/Class.pm')
-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(@_)