};
}
-sub parse_type_parameter {
+sub _parse_type_parameter {
my ($self, $type_parameter) = @_;
return Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($type_parameter);
}
sub parameterize {
- my ( $self, $contained_tc ) = @_;
+ my ($self, $type_parameter) = @_;
+
+ my $contained_tc = $self->_parse_type_parameter($type_parameter);
if ( $contained_tc->isa('Moose::Meta::TypeConstraint') ) {
my $tc_name = $self->name . '[' . $contained_tc->name . ']';
=item B<generate_constraint_for>
-=item B<parse_type_parameter>
-
-Given a string, convert it to a Perl structure.
-
=item B<parameterize>
Given an array of type constraints, parameterize the current type constraint.
sub _create_parameterized_type_constraint {
my ( $base_type_tc, $type_parameter ) = @_;
if ( $base_type_tc->can('parameterize') ) {
- my @type_parameters_tc
- = $base_type_tc->parse_type_parameter($type_parameter);
- return $base_type_tc->parameterize(@type_parameters_tc);
+ return $base_type_tc->parameterize($type_parameter);
}
else {
return Moose::Meta::TypeConstraint::Parameterized->new(