1 package MooseX::StrictConstructor::Trait::Method::Constructor;
5 use namespace::autoclean;
9 around '_generate_BUILDALL' => sub {
13 my $source = $self->$orig();
14 $source .= ";\n" if $source;
18 map { B::perlstring($_) . ' => 1,' }
20 map { $_->init_arg() } @{ $self->_attributes() }
25 $source .= "use feature 'state';\n";
30 $MY \$attrs = { @attrs };
31 if (my \@bad = sort grep { ! \$attrs->{\$_} } keys %\$params) {
32 Moose->throw_error("Found unknown attribute(s) passed to the constructor: \@bad");
41 # ABSTRACT: A role to make immutable constructors strict
49 This role simply wraps C<_generate_BUILDALL()> (from
50 C<Moose::Meta::Method::Constructor>) so that immutable classes have a