added compatibility to type constraints generated by MX::TypeLibrary
John Napiorkowski [Mon, 8 Sep 2008 22:07:56 +0000 (22:07 +0000)]
lib/MooseX/Types/Structured.pm

index 9497b36..300a73c 100644 (file)
@@ -151,7 +151,10 @@ sub Dict {
 
 sub _normalize_type_constraint {
        my $tc = shift @_;
-       if(defined $tc && blessed $tc && $tc->isa('Moose::Meta::TypeConstraint')) {
+       
+       ## If incoming is an object, we will assume it's something that implements
+       ## what a type constraint is.  We should probably have a Role for this...
+       if(defined $tc && blessed $tc) {
                return $tc;
        } elsif($tc) {
                return Moose::Util::TypeConstraints::find_or_parse_type_constraint($tc);