- # First, try a possible user defined constraint
- my $user = $tc->user_constraint;
- if (defined $user) {
- my $ok = $user->($thing);
- return 1 if $ok;
- }
-
- # Then, it's valid if and only if it passes the parent type constraint
- return $tc->parent->check($thing);