Subject: | Modification of a read-only value attempted at parameter validation for '__ANON__' |
Heya, so the following test fails:
use strict;
use warnings FATAL=> 'all';
use Test::More;
use Type::Params qw[ compile ];
use Types::Standard qw[ slurpy Dict Bool ];
use Data::Dumper::Concise;
my $check = compile(
slurpy Dict [
with_connection => Bool,
],
);
#diag Dumper($check);
for (qw[ 1 2 3 ]) {
ok $check->( with_connection=> 1, );
}
The issue is some generated code:
$_ = ($#_ - 0) % 2 == 0 ? 'Error::TypeTiny::WrongNumberOfParameters'->throw('message', 'Odd number of element
in Dict[with_connection=>Bool]') : {@_[0 .. $#_]};
$_ is not localized, and fails when assigning to it.