1 package MooseX::StrictConstructor::Trait::Class;
5 use namespace::autoclean;
10 around '_inline_BUILDALL' => sub {
14 my @source = $self->$orig();
18 map { B::perlstring($_) . ' => 1,' }
20 map { $_->init_arg() } $self->get_all_attributes()
25 'my %attrs = (' . ( join ' ', @attrs ) . ');',
26 'my @bad = sort grep { !$attrs{$_} } keys %{ $params };',
28 'Carp::confess "Found unknown attribute(s) passed to the constructor: @bad";',
35 # ABSTRACT: A role to make immutable constructors strict
43 This role simply wraps C<_inline_BUILDALL()> (from
44 C<Moose::Meta::Class>) so that immutable classes have a