3 # In the case where a child type constraint's parent constraint fails,
4 # the exception should reference the parent type constraint that actually
5 # failed instead of always referencing the child'd type constraint
13 use Moose::Util::TypeConstraints;
16 subtype 'ParentConstraint' => as 'Str' => where {0};
17 }, undef, 'specified parent type constraint' );
21 $tc = subtype 'ChildConstraint' => as 'ParentConstraint' => where {1};
22 }, undef, 'specified child type constraint' );
25 my $errmsg = $tc->validate();
28 local $TODO = 'Not yet supported';
29 ok($errmsg !~ /Validation failed for 'ChildConstraint'/, 'exception references failing parent constraint');