From: gfx Date: Sun, 20 Dec 2009 07:42:22 +0000 (+0900) Subject: No need to pass name => __ANON__ in _create_type() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=393fb1b772d898d6952612826ecb4ebe99857370;p=gitmo%2FMouse.git No need to pass name => __ANON__ in _create_type() --- diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index ebb71dd..12a9a1b 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -96,8 +96,10 @@ sub _create_type{ if(!defined $name){ $name = $args{name}; } + else{ + $args{name} = $name; + } - $args{name} = $name; my $parent; if($mode eq 'subtype'){ $parent = delete $args{as}; @@ -115,9 +117,6 @@ sub _create_type{ . "$existing->{package_defined_in} and cannot be created again in $package_defined_in"); } } - else{ - $args{name} = '__ANON__'; - } $args{constraint} = delete $args{where} if exists $args{where}; $args{optimized} = delete $args{optimized_as} if exists $args{optimized_as};