defined $_ ? $_->_compiled_type_constraint : undef;
} @type_constraints;
- my $code = $self->_compile_code(
+ my ( $code, $e ) = $self->_compile_code(
code => $source,
environment => {
'$meta' => \$self,
'@type_constraints' => \@type_constraints,
'@type_constraint_bodies' => \@type_constraint_bodies,
},
- ) or $self->throw_error("Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@", error => $@, data => $source );
+ );
+
+ $self->throw_error("Could not eval the constructor :\n\n$source\n\nbecause :\n\n$e", error => $e, data => $source )
+ if $e;
$self->{'body'} = $code;
}