1 package MooseX::StrictConstructor::Trait::Class;
11 around '_inline_BUILDALL' => sub {
15 my @source = $self->$orig();
19 map { B::perlstring($_) . ' => 1,' }
21 map { $_->init_arg() } $self->get_all_attributes()
26 'my %attrs = (' . join(' ', @attrs) . ');',
27 'my @bad = sort grep { !$attrs{$_} } keys %{ $params };',
29 'Carp::confess "Found unknown attribute(s) passed to the constructor: @bad";',
38 # ABSTRACT: A role to make immutable constructors strict
46 This role simply wraps C<_inline_BUILDALL()> (from
47 C<Moose::Meta::Class>) so that immutable classes have a