Compat for Moose
gfx [Tue, 27 Oct 2009 04:08:49 +0000 (13:08 +0900)]
lib/Mouse/Meta/Method/Accessor.pm

index c4f7356..04fd6b8 100755 (executable)
@@ -97,8 +97,6 @@ sub _generate_accessor{
         }
         elsif(defined $constraint){
             $accessor .= "my \$tmp = $value;\n";
-            #XXX: The following 'defined and' check is for backward compatibility
-            $accessor .= "defined(\$tmp) and ";
 
             $accessor .= "\$compiled_type_constraint->(\$tmp)";
             $accessor .= " || \$attribute->verify_type_constraint_error(\$name, \$tmp, \$constraint);\n";