From: Stevan Little Date: Mon, 20 Mar 2006 20:34:06 +0000 (+0000) Subject: uploadin X-Git-Tag: 0_05~81 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d46a48f319bb9f6bca00cbeb558c434226917f90;p=gitmo%2FMoose.git uploadin --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 0d1068d..fdc0903 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -228,6 +228,9 @@ this module would not be possible (and it wouldn't have a name). =item The basis of the TypeContraints module was Rob Kinyon's idea originally, I just ran with it. +=item Much love to mst & chansen and the whole #moose poose for all the +ideas/feature-requests/encouragement + =back =head1 SEE ALSO diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index 395a8dc..42c7bef 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -29,6 +29,8 @@ sub import { sub register_type_constraint { my ($type_name, $type_constraint) = @_; + (not exists $TYPES{$type_name}) + || confess "The type constraint '$type_name' has already been registered"; $TYPES{$type_name} = $type_constraint; } @@ -56,6 +58,8 @@ sub import { sub register_type_coercion { my ($type_name, $type_coercion) = @_; + (not exists $COERCIONS{$type_name}) + || confess "The type coercion for '$type_name' has already been registered"; $COERCIONS{$type_name} = $type_coercion; } }