# ensures the prototypes are in scope when consumers are
# compiled.
-# creation and location
-sub find_type_constraint ($);
-sub register_type_constraint ($);
-sub find_or_create_type_constraint ($;$);
-sub find_or_parse_type_constraint ($);
-sub find_or_create_isa_type_constraint ($);
-sub find_or_create_does_type_constraint ($);
-sub create_type_constraint_union (@);
-sub create_parameterized_type_constraint ($);
-sub create_class_type_constraint ($;$);
-sub create_role_type_constraint ($;$);
-sub create_enum_type_constraint ($$);
-
# dah sugah!
sub type ($$;$$);
sub subtype ($$;$$$);
}
}
-sub create_type_constraint_union (@) {
+sub create_type_constraint_union {
my @type_constraint_names;
if (scalar @_ == 1 && _detect_type_constraint_union($_[0])) {
);
}
-sub create_parameterized_type_constraint ($) {
+sub create_parameterized_type_constraint {
my $type_constraint_name = shift;
my ($base_type, $type_parameter) = _parse_parameterized_type_constraint($type_constraint_name);
}
#should we also support optimized checks?
-sub create_class_type_constraint ($;$) {
+sub create_class_type_constraint {
my ( $class, $options ) = @_;
# too early for this check
Moose::Meta::TypeConstraint::Class->new( %options );
}
-sub create_role_type_constraint ($;$) {
+sub create_role_type_constraint {
my ( $role, $options ) = @_;
# too early for this check
}
-sub find_or_create_type_constraint ($;$) {
+sub find_or_create_type_constraint {
my ( $type_constraint_name, $options_for_anon_type ) = @_;
if ( my $constraint = find_or_parse_type_constraint($type_constraint_name) ) {
return;
}
-sub find_or_create_isa_type_constraint ($) {
+sub find_or_create_isa_type_constraint {
my $type_constraint_name = shift;
find_or_parse_type_constraint($type_constraint_name) || create_class_type_constraint($type_constraint_name)
}
-sub find_or_create_does_type_constraint ($) {
+sub find_or_create_does_type_constraint {
my $type_constraint_name = shift;
find_or_parse_type_constraint($type_constraint_name) || create_role_type_constraint($type_constraint_name)
}
-sub find_or_parse_type_constraint ($) {
+sub find_or_parse_type_constraint {
my $type_constraint_name = normalize_type_constraint_name(shift);
my $constraint;
## exported functions ...
## --------------------------------------------------------
-sub find_type_constraint ($) {
+sub find_type_constraint {
my $type = shift;
if ( blessed $type and $type->isa("Moose::Meta::TypeConstraint") ) {
}
}
-sub register_type_constraint ($) {
+sub register_type_constraint {
my $constraint = shift;
Moose->throw_error("can't register an unnamed type constraint") unless defined $constraint->name;
$REGISTRY->add_type_constraint($constraint);
);
}
-sub create_enum_type_constraint ($$) {
+sub create_enum_type_constraint {
my ( $type_name, $values ) = @_;
Moose::Meta::TypeConstraint::Enum->new(