X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStrictConstructor%2FTrait%2FClass.pm;h=579b6c25d81156b7fc9f68afdc7ec7545590d34d;hb=0dc0aea2e2ce6e27b488b6e6d304c5ab19649745;hp=0c73318f84c77755798e648490df078e3e9ac62d;hpb=714128ef886ae4a37d5aefe6910a7581150ec149;p=gitmo%2FMooseX-StrictConstructor.git diff --git a/lib/MooseX/StrictConstructor/Trait/Class.pm b/lib/MooseX/StrictConstructor/Trait/Class.pm index 0c73318..579b6c2 100644 --- a/lib/MooseX/StrictConstructor/Trait/Class.pm +++ b/lib/MooseX/StrictConstructor/Trait/Class.pm @@ -27,6 +27,19 @@ around '_inline_BUILDALL' => sub { 'Moose->throw_error("Found unknown attribute(s) passed to the constructor: @bad");', '}', ); +} if $Moose::VERSION >= 1.9900; + +# If the base class role is applied first, and then a superclass is added, we +# lose the role. +after superclasses => sub { + my $self = shift; + + return unless @_; + + Moose::Util::MetaRole::apply_base_class_roles( + for => $self->name(), + roles => ['MooseX::StrictConstructor::Role::Object'], + ); }; 1;