1 package Mouse::Meta::TypeConstraint;
4 use overload '""' => sub { shift->{name} }, # stringify to tc name
10 my $name = $args{name} || '__ANON__';
12 my $check = $args{_compiled_type_constraint} or Carp::croak("missing _compiled_type_constraint");
13 if (ref $check eq 'Mouse::Meta::TypeConstraint') {
14 $check = $check->{_compiled_type_constraint};
17 bless +{ name => $name, _compiled_type_constraint => $check }, $class;
20 sub name { shift->{name} }
24 $self->{_compiled_type_constraint}->(@_);
32 Mouse::Meta::TypeConstraint - The Mouse Type Constraint Metaclass
36 For the most part, the only time you will ever encounter an
37 instance of this class is if you are doing some serious deep
38 introspection. This API should not be considered final, but
39 it is B<highly unlikely> that this will matter to a regular