Subject: | subtypes do not recurse; and SingleDigit is broken |
The subtype tests do not recurse. It only runs through the first two
levels. This is because the creation itself isn't really recursive.
Also, SingleDigit doesn't make sense to be a subtype of
'NegativeIntOrZero'. However, since it's about the only example of a
"two-level deep" subtype nesting in your module, I'm going to use it in
this code example:
package Dummy::MooseLike::Test;
use v5.10;
use Moo;
use MooX::Types::MooseLike::Numeric qw(:all);
no strict 'refs';
has 'Test_SingleDigit' => (
is => 'rw',
isa => SingleDigit,
);
package main;
my $obj = Dummy::MooseLike::Test->new();
$obj->Test_SingleDigit(-2.5);
====================
So, it passes SingleDigit, and then passes NegativeIntOrZero, but it
doesn't pass Int. However, Int is never checked, and so the value is
"valid" without any errors.