Subject: | Parametrized type constraints don't call their "where" clause anymore |
The following piece of code
#########################################
use strict;
use warnings;
{
package X;
use Mouse;
use Mouse::Util::TypeConstraints;
subtype 'List'
=> as 'ArrayRef[Any]'
=> where { die "whoops" };
has 'list' => (
is => 'ro',
isa => 'List',
);
}
X->new(list => [ 1 ]);
#########################################
stopped calling the "where" clause (thus stopped throwing an exception)
during versions 0.71 and 0.72. More precisely, I bisected
5a592ad728880fb6a21e9610cbfeb1670f2053ab to be the first wrong commit.
If 'ArrayRef[Any]' is replaced by a simple 'ArrayRef', the code behaves
correctly.
Regards,
Vincent Pit.
Subject: | param_type_constraint_where_bug.pl |
use strict;
use warnings;
{
package X;
use Mouse;
use Mouse::Util::TypeConstraints;
subtype 'List'
=> as 'ArrayRef[Any]'
=> where { die "whoops" };
has 'list' => (
is => 'ro',
isa => 'List',
);
}
X->new(list => [ 1 ]);