X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FTypeConstraint%2FParameterized.pm;h=3d7cbaef0717d40aaf473a31dd11bac10a2d4227;hb=bb6c833559f9e6ac403628d8ec4d09af2a0477e1;hp=f76feb86bcb782a3f23b6f3e0fd9d53d8ccbf0f8;hpb=f4cbcca146f48c91c74ae618f71895376fd338a4;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/TypeConstraint/Parameterized.pm b/lib/Moose/Meta/TypeConstraint/Parameterized.pm index f76feb8..3d7cbae 100644 --- a/lib/Moose/Meta/TypeConstraint/Parameterized.pm +++ b/lib/Moose/Meta/TypeConstraint/Parameterized.pm @@ -5,10 +5,9 @@ use warnings; use metaclass; use Scalar::Util 'blessed'; -use Carp 'confess'; use Moose::Util::TypeConstraints; -our $VERSION = '0.55_03'; +our $VERSION = '0.57'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -37,12 +36,12 @@ sub compile_type_constraint { my $self = shift; ($self->has_type_parameter) - || confess "You cannot create a Higher Order type without a type parameter"; + || Moose->throw_error("You cannot create a Higher Order type without a type parameter"); my $type_parameter = $self->type_parameter; (blessed $type_parameter && $type_parameter->isa('Moose::Meta::TypeConstraint')) - || confess "The type parameter must be a Moose meta type"; + || Moose->throw_error("The type parameter must be a Moose meta type"); foreach my $type (Moose::Util::TypeConstraints::get_all_parameterizable_types()) { if (my $constraint = $type->generate_constraint_for($self)) { @@ -53,8 +52,8 @@ sub compile_type_constraint { # if we get here, then we couldn't # find a way to parameterize this type - confess "The " . $self->name . " constraint cannot be used, because " - . $self->parent->name . " doesn't subtype or coerce from a parameterizable type."; + Moose->throw_error("The " . $self->name . " constraint cannot be used, because " + . $self->parent->name . " doesn't subtype or coerce from a parameterizable type."); } 1;