Subject: | Failure while validating read-only against typeconstraint |
Hi!
The following code breaks for me:
<snip>
use Moose::Util::TypeConstraints;
use Readonly;
my $t = subtype as 'Str',
where { 1 };
Readonly our $data => 'lala';
map { $t->validate( $_ ) } $data;
</snip>
The stacktrace is:
<snip>
Modification of a read-only value attempted at /usr/lib64/perl5/site_perl/5.8.8/Readonly.pm line 75
Readonly::Scalar::__ANON__('Readonly::Scalar=SCALAR(0x1520c70)', undef) called at /home/newuser/perl5/lib/perl5/x86_64-linux-thread-
multi/Moose/Meta/TypeConstraint.pm line 395
Moose::Meta::TypeConstraint::__ANON__('lala') called at /home/newuser/perl5/lib/perl5/x86_64-linux-thread-multi/Moose/Meta/TypeConstraint.pm line 195
Moose::Meta::TypeConstraint::validate('Moose::Meta::TypeConstraint=HASH(0x154b500)', 'lala') called at /usr/lib64/perl5/site_perl/5.8.8/Readonly.pm line 75
Readonly::Scalar::__ANON__('Readonly::Scalar=SCALAR(0x1520c70)', undef) called at /home/newuser/perl5/lib/perl5/x86_64-linux-thread-
multi/Moose/Meta/TypeConstraint.pm line 395
Moose::Meta::TypeConstraint::__ANON__('lala') called at /home/newuser/perl5/lib/perl5/x86_64-linux-thread-multi/Moose/Meta/TypeConstraint.pm line 195
Moose::Meta::TypeConstraint::validate('Moose::Meta::TypeConstraint=HASH(0x154b500)', 'lala') called at ./test.pl line 10
Modification of a read-only value attempted at /usr/lib64/perl5/site_perl/5.8.8/Readonly.pm line 75
Readonly::Scalar::__ANON__('Readonly::Scalar=SCALAR(0x1520c70)', 'lala') called at /usr/lib64/perl5/site_perl/5.8.8/Readonly.pm line 75
Readonly::Scalar::__ANON__('Readonly::Scalar=SCALAR(0x1520c70)', 'lala') called at /usr/lib64/perl5/5.8.8/Carp.pm line 100
</snip>
perl v5.8.8 built for x86_64-linux-thread-multi
Moose v2.0603
Readonly v1.03