From ff20617797652889b66b548bd05fcd9e0e55320e Mon Sep 17 00:00:00 2001 From: doy Date: Mon, 20 Apr 2009 19:10:08 -0500 Subject: support using the metaclass trait without using the constructor trait --- lib/MooseX/NonMoose/Meta/Role/Class.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/MooseX/NonMoose') 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(@_) -- cgit v1.2.3-54-g00ecf