Subject: | deep recursion error for many valued Enum + Undef |
The following code on Perl 5.22.1, Type::Tiny 1.002, Type::Tiny::XS 0.012
{
package MyTypes;
use strict;
use warnings;
use Type::Library -base, -declare => qw( Filetype );
use Type::Utils -all;
use Types::Standard qw[ Enum ];
declare Filetype, as Enum [ 0 .. 200 ];
}
{
package Bar;
use Types::Standard qw[ Undef ];
use Moo;
# causes deep recursion
has foo => ( is => 'rw', isa => MyTypes::Filetype | Undef );
# does not cause deep recursion
has bar => ( is => 'rw', isa => MyTypes::Filetype );
}
results in
Deep recursion on subroutine "Type::Tiny::XS::_handle_expr" at [...]/Type/Tiny/XS.pm line 147.
Deep recursion on subroutine "Type::Tiny::XS::_handle_expr" at [...]/Type/Tiny/XS.pm line 147.
This happens only if Filetype | Undef is used. If just Filetype is used, the error does not occur.
Thanks,
Diab