Stop blowing up in has_available_type_export if the introspected code symbol exists...
Florian Ragwitz [Tue, 18 Aug 2009 05:39:54 +0000 (07:39 +0200)]
lib/MooseX/Types/Util.pm

index 312df4b..93601e2 100644 (file)
@@ -8,6 +8,7 @@ MooseX::Types::Util - Common utility functions for the module
 
 use warnings;
 use strict;
+use Scalar::Util 'blessed';
 
 use base 'Exporter';
 
@@ -88,7 +89,7 @@ sub has_available_type_export {
         or return undef;
 
     return undef
-        unless $sub->isa('MooseX::Types::EXPORTED_TYPE_CONSTRAINT');
+        unless blessed $sub && $sub->isa('MooseX::Types::EXPORTED_TYPE_CONSTRAINT');
 
     return $sub->();
 }