sub MooseX::Antlers::ImmutableHackFor::One::make_immutable { package Class::MOP::Method::Generated; use strict; use warnings; { my $__captures = { "\$meta" => \"MooseX::Antlers::ErrorThrower", "\@triggers" => [ undef ] } ; # fixup code for external references $__captures->{"\@triggers"}->[0] = $has_args{"foo"}->[6]; my @triggers = @{$__captures->{'@triggers'}}; my $meta = ${$__captures->{'$meta'}}; *One::new = Sub::Name::subname "One::new" => #line 0 "generated method (unknown origin)" sub { my $_instance = shift; my $class = Scalar::Util::blessed($_instance) || $_instance; return $class->Moose::Object::new(@_) if $class ne 'One'; my $params = do { $meta->throw_error("Single parameters to new() must be a HASH ref", data => $_[0]) if scalar @_ == 1 && !( defined $_[0] && ref $_[0] eq q{HASH} ); (scalar @_ == 1) ? {%{$_[0]}} : {@_}; }; my $instance = bless {} => $class; ## foo (exists $params->{'foo'}) || $meta->throw_error("Attribute (foo) is required"); (exists $params->{'foo'}) && do { my $val = $params->{'foo'}; $instance->{"foo"} = $val; }; (exists $params->{'foo'}) && do { $triggers[0]->($instance, $instance->{"foo"}, ); }; ; return $instance; }; } { my $__captures = {} ; *One::DESTROY = Sub::Name::subname "One::DESTROY" => #line 0 "generated method (unknown origin)" sub { }; } }