Skip Menu |

This queue is for tickets about the MooseX-Params-Validate CPAN distribution.

Report information
The Basics
Id: 101988
Status: resolved
Priority: 0/
Queue: MooseX-Params-Validate

People
Owner: Nobody in particular
Requestors: bill.brinzer [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.18
  • 0.19
Fixed in: (no value)



Subject: Copy & paste bug in MooseX::Params::Validate::_convert_to_param_validate_spec
Copy & paste bug in MooseX::Params::Validate::_convert_to_param_validate_spec. Affects cases where $spec->{does} is a type constraint object (as opposed to, say, a type name): sub _convert_to_param_validate_spec { ... my $constraint; if ( defined $spec->{isa} ) { $constraint = _is_tc( $spec->{isa} ) || Moose::Util::TypeConstraints::find_or_parse_type_constraint( $spec->{isa} ) || class_type( $spec->{isa} ); } elsif ( defined $spec->{does} ) { $constraint = _is_tc( $spec->{isa} ) ^^^^^ HERE ^^^^^ || find_type_constraint( $spec->{does} ) || role_type( $spec->{does} ); } The line marked "HERE" should be using $spec->{does} since $spec->{isa} is guaranteed to be undef at this point.
Thanks for this repo. I fixed this in git. It turns out that despite the typo, the code worked entirely as intended, because of the way Moose::Util::TypeConstraint::find_type_constraint works.