X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FUtil%2FTypeConstraints.pm;h=4f77130b4b090b189d90d4a010855c898cc5bad2;hp=cf03de9631b25b7baccefd0d4c168e100749c32e;hb=29607c0291634fac077d6e1c75e1491ba455c010;hpb=e82cf08d6ab36c4269c82cb2e066defee22a26d8 diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index cf03de9..4f77130 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -109,8 +109,8 @@ sub subtype { if ($TYPE{$name} && $TYPE_SOURCE{$name} ne $pkg) { Carp::croak "The type constraint '$name' has already been created in $TYPE_SOURCE{$name} and cannot be created again in $pkg"; }; - my $constraint = $conf{where}; - my $as_constraint = find_or_create_isa_type_constraint($conf{as} || 'Any'); + my $constraint = delete $conf{where}; + my $as_constraint = find_or_create_isa_type_constraint(delete $conf{as} || 'Any'); $TYPE_SOURCE{$name} = $pkg; $TYPE{$name} = Mouse::Meta::TypeConstraint->new( @@ -126,6 +126,7 @@ sub subtype { $as_constraint->check($_[0]); } ), + %conf ); return $name;