diff options
author | doy <doy@tozt.net> | 2009-04-20 19:10:08 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-04-20 19:10:08 -0500 |
commit | ff20617797652889b66b548bd05fcd9e0e55320e (patch) | |
tree | fe984cf19697bf1cdfd516462bf717da8a291076 /lib | |
parent | 92015bafc6d0f6bb4d79c029f73ec753829f20a0 (diff) | |
download | moosex-nonmoose-ff20617797652889b66b548bd05fcd9e0e55320e.tar.gz moosex-nonmoose-ff20617797652889b66b548bd05fcd9e0e55320e.zip |
support using the metaclass trait without using the constructor trait
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MooseX/NonMoose/Meta/Role/Class.pm | 5 |
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(@_) |