make sure a type constrain name makes sense, properly stringify it and set a default...
John Napiorkowski [Wed, 29 Oct 2008 15:45:39 +0000 (15:45 +0000)]
lib/Moose/Util/TypeConstraints.pm

index f84b57e..86caaa4 100644 (file)
@@ -373,9 +373,11 @@ sub _create_type_constraint ($$$;$$) {
                 . $pkg_defined_in )
             if defined $type;
     }
+    
+    $name = $name ? "$name" : "__ANON__";
 
     my %opts = (
-        name => $name || '__ANON__',
+        name => $name,
         package_defined_in => $pkg_defined_in,
 
         ( $check     ? ( constraint => $check )     : () ),