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