From: Dave Rolsky Date: Sun, 14 Sep 2008 21:56:49 +0000 (+0000) Subject: There's no need ot expose Parameterizable's ->parse_type_constraint X-Git-Tag: 0.58~37^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=44b5ec584b3edb967cc63767951befad792182e3;p=gitmo%2FMoose.git There's no need ot expose Parameterizable's ->parse_type_constraint method as a public method, since it was used once, and it's return value was passed right back into said module. --- diff --git a/lib/Moose/Meta/TypeConstraint/Parameterizable.pm b/lib/Moose/Meta/TypeConstraint/Parameterizable.pm index 7b61ebb..8e92ef0 100644 --- a/lib/Moose/Meta/TypeConstraint/Parameterizable.pm +++ b/lib/Moose/Meta/TypeConstraint/Parameterizable.pm @@ -42,13 +42,15 @@ sub _can_coerce_constraint_from { }; } -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 . ']'; @@ -85,10 +87,6 @@ Moose::Meta::TypeConstraint::Parameterizable - Higher Order type constraints for =item B -=item B - -Given a string, convert it to a Perl structure. - =item B Given an array of type constraints, parameterize the current type constraint. diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index 858a390..39e2acf 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -136,9 +136,7 @@ sub create_parameterized_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(