use base 'Moose::Meta::TypeConstraint';
use Moose::Meta::TypeConstraint::Parameterized;
+use Moose::Util::TypeConstraints ();
__PACKAGE__->meta->add_attribute('constraint_generator' => (
accessor => 'constraint_generator',
sub parse_parameter_str {
my ($self, $type_str) = @_;
- return find_or_create_isa_type_constraint($type_str);
+ return Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($type_str);
}
sub parameterize {
my ($tc_name, $base_type_tc, $type_parameter_str) = @_;
if($base_type_tc->can('parameterize')) {
my @type_parameters_tc = $base_type_tc->parse_parameter_str($type_parameter_str);
- return $base_type_tc->parameterize($tc_name,@type_parameters_tc);
+ return $base_type_tc->parameterize($tc_name, @type_parameters_tc);
} else {
return Moose::Meta::TypeConstraint::Parameterized->new(
name => $tc_name,
parent => $base_type_tc,
- type_parameter => find_or_create_isa_type_constraint[$type_parameter_str],
+ type_parameter => find_or_create_isa_type_constraint($type_parameter_str),
);
}
}
} else {
return;
}
-
+
$REGISTRY->add_type_constraint($constraint);
return $constraint;
}